String to GUI Text??

I am trying to get a refernce of a number to display with GUI text, I am getting an error-

“Cannot implicitly convert type string' to UnityEngine.GUIText”

/
/
/
public GUIText Roundsleft;
	
	void UpDate() 
	{
	Roundsleft = (Player.RoundsLeft).ToString("Rounds Left:");
	}
/
/
/

How else would I do this???

Roundsleft.text = (Player.RoundsLeft).ToString(“Rounds Left:”);

Roundsleft.text

is what you’re looking for.

Tried it, the numbers are not showing.

Thanks

That’s because your code for what you display doesn’t seem to be correct either, not just the link to the text variable.

Roundsleft.text = "Rounds Left: " + Player.RoundsLeft.ToString();

That didn’t do it either, I tried that before, But I didn’t have the .text in there. This works with a GUI Label, but I want to be able to control where it is seen…

If it’s a GUIText object, you can move it around on the screen. You can also use a GUI.Label that gives you an exact control of what pixels on screen show the label.

I know, but the GUI Text isn’t showing the numbers like the label, and the label is on every camera and I was told that you can not stop the rendering on OnGUI labels.

I got it to show, by putting it in the start function but it isn’t counting down on firing??

I go it to work, by putting it in OnGUI, I didn’t realize I had to do that with GUIText…

Your Update was UpDate

Good eye, thanks, now it works in Update…:slight_smile:

:slight_smile: eagle eye they call meh. :slight_smile: