- Home /
Any other method to hide and show gameobjects?
Hello
till now if i want to hide a game object i just throw it in a position out of the screen, and if i want to show it again i just return it to its original place.
But i found that method is time consuming and not effective.
so is Any other method to hide and show gameobjects?
Answer by imp903 · Jun 20, 2015 at 01:12 AM
yes, the method gameObject.SetActive() takes a boolean and will set it active or inactive in your hierarchy without losing any of the settings it had prior to being set inactive. So gameObject.SetActive(false) sets it to be disabled while gameObject.SetActive(true) means that it is set to active.
but then i cant access any of its component or children, right?
Your answer
Follow this Question
Related Questions
Can I hide/show objects by layer or tags? 3 Answers
hide and show node for turret places 1 Answer
Reloading a Scene throws NullReferenceException on GO with nested Prefabs 0 Answers
help hiding object? 2 Answers
How to hide AdMob ads? 1 Answer