4
\$\begingroup\$

I'm trying to deactivate an GameObject when a certain variable reaches a certain value. It is an imported FBX and doesnt have a MeshRenderer. I'm trying to stop it now with TheGameObject.gameObject.activate = false; then nothing happens.

Is there any other way to do this or fix this?

\$\endgroup\$
5
\$\begingroup\$

The property is active, not activate. And you can try using SetActiveRecursively if your game object has multiple child objects. Just setting the active flag doesn't set the active flags of child objects.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.