1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    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
    Posts:
    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
    Posts:
    512
  3. Warp boy2

    Warp boy2

    Joined:
    Nov 12, 2010
    Posts:
    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
    Posts:
    1,224