Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1.5 regression? GetComponentInChildren doesn't get component in self. #56

Closed
laurentopia opened this issue Jul 17, 2024 · 7 comments
Closed

Comments

@laurentopia
Copy link

It used to.
And GetComponentInChildren does that.
image

@laurentopia
Copy link
Author

image

@laurentopia
Copy link
Author

laurentopia commented Jul 17, 2024

and when I set a reference by hand to same-level it complains.
image

@TylerTemp
Copy link
Owner

Hi,

By design GetComponentInChildren does not get component from self, this is different from Unity (so as GetComponentInParent(s))

However I am planing to change this behavior to align with Unity (in the next release) as it is confusing. Also because in previous version we can use GetComponent + GetComponentInChildren, but in last release they can no longer work together... So yeah it indeed needs to be changed.

@laurentopia
Copy link
Author

Ok, good to know.

@laurentopia
Copy link
Author

which is the latest version supporting getcomponent + getcomponentinchildren?

@TylerTemp
Copy link
Owner

3.1.3 does
3.1.4 GetComponent* start to support array, which break the GetComponent + GetComponentInChildren

@TylerTemp
Copy link
Owner

Hi @laurentopia ,

this behavior has been changed in 3.2.0. This version has some breaking changes, please read the change log before upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants