Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

SetActive(True) toggling active state of children

Discussion in 'Unity UI (uGUI) & 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