Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Roll-a-ball'er, problem at step 07 - Displaying Text

Discussion in 'Getting Started' started by Iceforge, Feb 9, 2015.

  1. Iceforge

    Iceforge

    Joined:
    Feb 9, 2015
    Posts:
    2
    Greetings Unity Community, new member here and currently working through some of the learn videos, very interesting stuff and very helpful videos.

    I started off with the survival shooter and got that all functioning perfectly (even compiled it into an installer with a 3rd party open source software, felt very cool to have an installer for something I had coded, at least partially, myself)

    Now I am almost through with the Roll-a-ball'er tutorial and on the display text section, after coding a count and making the public GUIText countText function in the script for PlayerController.cs, the video instructs that I can simply drag-n-drop the Display Text element into the GUIText field on the script under the Player tab in the Heirachy (sorry if my terminology is faulty)

    Already when I was creating the display text I had some trouble, as it seems 4.6 does UI text differently than the 4.0 version he seems to be using, wanting to put UI text on Canvas layer in heirachy, rather than into the gameobject group of Display Text.

    However much I try and alter things around, I cannot seem to get this count text to link automatically through drag and drop.

    Now, I do NOT want anyone here to tell me how to script this (how will I learn, if anyone just give me the script?), I just want to know that this is indeed due to functionality issues between 4.0 and 4.6, and its not just me doing something wrong, when trying to follow the instructions?

    Currently going to go back to the survival shooter, cause I know it teached me how to script something like this, so I'll implement that lesson to fix it here, but I just wanted to be sure that it is indeed just a matter of 4.0 having a function that no longer seems to work in 4.6, for future reference :)
     
  2. Napivo

    Napivo

    Joined:
    Feb 9, 2015
    Posts:
    39
    I had the same problem too and found the unofficial fix here

     
    Kiwasi likes this.
  3. Iceforge

    Iceforge

    Joined:
    Feb 9, 2015
    Posts:
    2
    Perfect, thank you, Napivo
     
  4. kdubnz

    kdubnz

    Joined:
    Apr 19, 2014
    Posts:
    177
    And thanks to Richard for putting a solution together. :)
     
    Kiwasi likes this.
  5. Napivo

    Napivo

    Joined:
    Feb 9, 2015
    Posts:
    39
    Yes of course... this is not my work... just provided a link

    Thank you Richard :)
     
    Kiwasi likes this.
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Your welcome. I was about to post a link to it here, then saw someone had done it already. Its a surreal feeling seeing someone share one of my tutorials. I made this video because the question comes up so often, text answers are often hard for beginners to get their head around. I figured keeping as close to the original as possible would be the best way to help.

    For reference the GUIText feature is available in 4.6. You just have to access it through the AddComponent menu. In general the feature no longer serves any purpose, but its included for backwards compatibility. I would be very surprised if it makes it into 5.0.
     
  7. jshrek

    jshrek

    Joined:
    Mar 30, 2013
    Posts:
    220
    Which feature no longer serves any purpose ... the GUIText they recommend in the tutorial under Component > Rendering > GUIText or the UI Text you use in your example under GameObject > UI > Text ?
     
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    GUIText is no longer in use, as shown in the original video. UI.Text as shown in my video is the current way to display text.