Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

no gameobject.active in a prefab?

Discussion in 'Editor & General Support' started by llavigne, Jul 29, 2008.

  1. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    that's odd, I can't set the gameobject child of a prefab to active = false... anyone knows how to do this ?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,662
    It's not entirely clear what you're trying to do, nor what is failing.

    Are you trying to set the state of the child of the GameObject prefab while it's a prefab (e.g., in the project view)? If so, "active" in that context is meaningless; none of them are active.

    Are you getting the transform's child? If so, that child will be another Transform and does not have .active; you'd have to make that .gameObject.active instead.
     
unityunity