Hey, I have a GUI text that counts when I destroy an object and is displayed in the GUI text on the screen. I would like to make another script that says when the number of destroyed objects shown in the GUI text is > 0, another script will become active. I was told that I need to change the GUI text I have to a float or int, since I have only whole numbers I will need to turn it into a int.
Thank you for help:)
You could do like this in c#:
floatCount = int.Parse(CountGuiText.text);
Can you not just have the text display a ‘static var enemies: int;’ then:
On your GUIText you can:
guitextObject.text = whateverscriptthestaticvarison.enemies.ToString();
and elsewhere you can have:
if (whateverscriptthestaticvarison.enemies > 0) blahblahblah
try to take a transform of the gui text than just take the text value on the gui text component and do whatever you want with it
Use int.Parse() for exemple, it will parse your text as an int.