Printing Integers

Hey guys
I get this error when I am trying to print an integer in a GUI.Label

Assets/TextBasedGame.js(601) error BCE0023: No appropriate version of ‘UnityEngine.GUI.Label’ for the argument list ‘(UnityEngine.Rect, int)’ was found.

Just wondering if I could get some help as to how to print it into a label?

Thanks!

Either explicitly:

GUILayout.Label(myInt.ToString());

or implicitly:

GUILayout.Label(“” + myInt);

Hey Matt
Thanks for the quick reply, sorry I am very new to all this but could you help me use the code in an example? This is the code to output my score at the moment which isnt outputting the variables

GUI.Label(Rect (50,310,100,50), hometeamname);
GUI.Label(Rect (200,310,100,50), homescoreset1);
GUI.Label(Rect (250,310,100,50), homescoreset2);
GUI.Label(Rect (300,310,100,50), homescoreset3);
GUI.Label(Rect (350,310,100,50), homescoreset4);
GUI.Label(Rect (400,310,100,50), homescoreset5);
GUI.Label(Rect (50,340,100,50), awayteamname);
GUI.Label(Rect (200,340,100,50), awayscoreset1);
GUI.Label(Rect (250,340,100,50), awayscoreset2);
GUI.Label(Rect (300,340,100,50), awayscoreset3);
GUI.Label(Rect (350,340,100,50), awayscoreset4);
GUI.Label(Rect (400,340,100,50), awayscoreset5);

Thanks mate!

Me again :slight_smile:
Got it all sorted, thanks again for your help!