Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    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. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    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