1. Submit bugs to enter our 5.4 Beta Sweepstakes. Read more about it here.
  2. Unity 5.4 public beta is now available for all users. Grab the build and visit the 5.4 beta forum.
  3. Missing a module? More about the new installer in 5.3 here.
  4. 4.7.1 released for Xcode 7.3 support. Thread here.

how do i activate a gameobject?

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

  1. Warp boy2

    Warp boy2

    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

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

    Warp boy2

    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

    Joined:
    Jun 2, 2009
    Messages:
    1,224