Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[Unity 5] How to display formatted UI text?

Discussion in 'UGUI & TextMesh Pro' started by fabio176, Mar 10, 2015.

  1. fabio176


    Mar 10, 2015
    I'm watching those tutorials on the official website, more specifically, the space shooter project.
    The problem is that I'm using Unity 5, and on the tutorials it uses Unity 4.x which has GUI Text that don't exist anymore (at least not the way it was) on Unity 5. So, I'm having a problem to put a formatted value to be displayed, like we do in C "....%d, %f..." var1, var2...

    I have a gameObject (target) with a script which destroys it when it is touched by the shots. So, in the script I made an int to count: each time an target is destroyed, count++. But I don't know how to "transfer" this var to the UI Text component inside of the canvas to be displayed... How to do it? Thanks.
  2. SimonDarksideJ


    Jul 3, 2012
    Best to watch the new UI tutorials and do a simple conversion. It'll take a while for the tutorials to catch up.
    I did write an article for Unt3DMag for upgrading your GUI but it got pushed back to next month ;-(