This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Invalid behavior of Component Extension SetActive #903
Labels
Bug
Something isn't working
Comments
It's a lot easier to set a component active/inactive using the This extension method was meant to be used purely to enable/disable the game object that the component is attached to. |
Yes, but "This extension method was meant to be used purely to enable/disable the game object that the component is attached to." Exactly, and that is what it is failing to do. |
IF the parent game object is disabled but the game object that it is attached to is not, then SetActive(false) won't disable it. |
The fix would be:
|
Makes sense to me. Thanks for catching this! 🙏 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
XRTK - Mixed Reality Toolkit Bug Report
Describe the bug
XRTK's component extension SetActive
is error prone and it differs from people would expect when setting a GameObject active / inactive.
activeInHierarchy
is not the same asactiveSelf
. If an object is notactiveInHierarchy
butactiveSelf
callingSetActive(false)
using this extension will result in the object not being set to inactive.The text was updated successfully, but these errors were encountered: