Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 4.6 GUI text problems.

Discussion in 'UGUI & TextMesh Pro' started by BokuDev, Dec 7, 2014.

  1. BokuDev

    BokuDev

    Joined:
    Jan 2, 2014
    Posts:
    81
    Hello, I'm trying to add a lives system/game-over system to my 3D platformer.
    The programming works and everything is functioning smoothly besides that the GUI for showing how many lives you have left isn't appearing..

    The inspector and script shows to use GUI text, but every-time I make GUI text in 4.6 canvases the life counter still never shows up on my screen... Maybe this is due to 4.6 not working with 3D text/GUI text anymore really?

    Is this due to Unity 4.6 not working with GUI text? What I do I call in the line of code then to get it on canvas?


    Here are some screenshots to help understand:

    http://gyazo.com/eb8ac4bbf1d759b8ab2fa960ad5db430

    http://gyazo.com/395e4438348a9d2a6834b4183f528542

    http://gyazo.com/1d35bca4dd3e21f2c4f547562c3d51e8
     
  2. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    You need to use UI->Text component/GameObject, not GUIText (which is for old-Unity Immediate Mode GUI)
     
  3. BokuDev

    BokuDev

    Joined:
    Jan 2, 2014
    Posts:
    81
    So what would I replace the "Gui.Text" with in the code? I found the 4.6 system has this text;
    http://gyazo.com/9b4054141fbefe108130f7ff8ff0ffe1

    I'm not sure how to call that text itself since looking up UI only thing I found is UILabel didn't see any UI.Text in the 4.6 documentation...

    Here is a look at my code again.. Any tips on what to change?
    http://gyazo.com/1d35bca4dd3e21f2c4f547562c3d51e8
    http://gyazo.com/feb229761dc039605459e46350909842
     
  4. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
  5. BokuDev

    BokuDev

    Joined:
    Jan 2, 2014
    Posts:
    81




    Got it now! Thank you!