1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  3. All Unity Pro perpetual license customers: your special offer to subscribe is ready! Click here.
    Dismiss Notice
  4. Unity 5.5 is now released.
    Dismiss Notice
  5. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  6. Unity 5.6 beta is now available for download.
    Dismiss Notice
  7. Get prepared for the Tizen Mobile App Incentive Program! Read more about the upcoming program here.
    Dismiss Notice
  8. Enter the Microsoft Developer Challenge for a chance to win prizes. Read more about it here.
    Dismiss Notice

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