[Solved] Trying to get two independent texts working

So I might be a bit in over my head here, but I wanted in my game you to be getting colder, which I want to represent with a number that decreases with each action. So I figure I need this number to be independent from the other text. The problem is how I do that! First I thought of creating an entirely new Text element, which would be be good for showing a number, but once it reaches zero, since it’s independent from the other text, it won’t have any effect on the game. So next I tried adding a new public text, temp, which you can see in the code. But I can only get either that or cave text to show in the game.

Am I on the right track here? Any help to help me work this out would be greatly appreciated! Attached is my code and what it looks like in the game.

Hi James,

You have two variables in the code for the text, but only one UI.Text game object in your hierarchy.

Add another UI.Text game object under your Canvas, then drag it onto your second public text field expose in your code.

That’s got it working. Thanks!

1 Like

You’re very welcome. :slight_smile:

Privacy & Terms