how do i activate a gameobject?

Discussion in 'Scripting' started by Warp boy2, Dec 20, 2010.

  1. Warp boy2

    Warp boy2

    New Member

    Joined:
    Nov 12, 2010
    Messages:
    216
    well.. i unchecked that box in the inspector

    [​IMG]

    and i made a script like this

    Code (csharp):
    1.  
    2.  
    3. function Update () {
    4.  
    5. if (Input.GetButtonDown ("shoot")) {
    6.  
    7. GameObject.Find("NEWPOINT").active = true;
    8.  
    9. }
    10. }
    11.  
    12.  
    but i doest not work.. am i doing something wrong?
     
  2. pakfront

    pakfront

    Member

    Joined:
    Oct 6, 2010
    Messages:
    496
  3. Warp boy2

    Warp boy2

    New Member

    Joined:
    Nov 12, 2010
    Messages:
    216
    so the gameObject.Find only finds active objects.. and thats why is not fidning the NEWPOINT because he is unchecked..

    damm...
     
  4. tonyd

    tonyd

    New Member

    Joined:
    Jun 2, 2009
    Messages:
    1,224