Search Unity

render cube problem

Discussion in 'Scripting' started by Nightshade1, Feb 19, 2012.

  1. Nightshade1

    Nightshade1

    Joined:
    Feb 6, 2011
    Posts:
    95
    when i make this script

    Code (csharp):
    1. var nxtlvl : boolean = false;
    2.  
    3.  
    4.  
    5. function React ()
    6.  
    7. {
    8.     nxtlvl = true;
    9. }
    10.  
    11. function Update ()
    12. {
    13.     if(nxtlvl)
    14.     {
    15.     GetComponent (MeshRenderer);
    16.     }
    17. }
    i know the boolean works but the getcomponent doesn't work because i need a cube to render any ideas?