Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

SetActive(True) toggling active state of children

Discussion in 'Unity UI & TextMesh Pro' started by Ezilybored, Aug 10, 2018.

  1. Ezilybored


    Jun 24, 2017
    Evening all,

    I have an issue with a UI element to my game.
    I have a canvas with a text box and 4 buttons all as children of another canvas. This parent canvas is to be used to turn the others on or off together.
    I set the active state of the parent canvas as off using the tick box in the inspector.
    The active state of all children is checked.
    When the game is not running and I check the box for the parent canvas all UI elements appear.
    When I run the game and do the same, they do not appear.
    When I run the game and the script calls the UI to appear, it does not.
    I looked at the check boxes for each element in the inspector when the game runs.
    When I checked the active state of the parent canvas to true, the check boxes of all children switch to false.
    Any ideas why? This doesn't happen with any of my other UI elements.

    Cheers in advance