Search Unity

updating text

Discussion in 'Scripting' started by xacto, Aug 19, 2005.

  1. xacto

    xacto

    Joined:
    Jul 20, 2005
    Posts:
    112
    I create a text object called "guiBalls" that will tell the player how many balls they have left. In a script that is attached to the camera, I try to access the guiBalls object and display the count. However when I run it it says: unknown identifier

    Here is the code:
    guiBalls.text = ballCount;

    How do I access the text object?

    :roll:
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Add the guiBalls variable to your script and connect it in the inspector.

    var guiBalls : GUIText;
     
  3. xacto

    xacto

    Joined:
    Jul 20, 2005
    Posts:
    112
    Works great! :D

    TY!