I’m not sure what I’m doing wrong here. For the String parameter I have also tried with a .ToString on both calls.
GUI.Label( new Rect(Screen.width/2, Screen.height*0.2, 150, 50), "$" + Money);
GUI.Label( new Rect(Screen.width*0.1, Screen.height*0.2, 150, 50), Depth + " ft.");
Any help on solving what I’m doing wrong would be greatly appreciated! Here are my variables used.
int Money = 50;
int Depth = 0;
I would really like to keep the variables int’s as well.
Here are the error’s.
error CS1502: The best overloaded method match for `UnityEngine.Rect.Rect(float, float, float, float)’ has some invalid arguments
error CS1503: Argument #2' cannot convert
double’ expression to type `float’
error CS1502: The best overloaded method match for `UnityEngine.GUI.Label(UnityEngine.Rect, string)’ has some invalid arguments
error CS1503: Argument #1' cannot convert
object’ expression to type `UnityEngine.Rect’
error CS1502: The best overloaded method match for `UnityEngine.Rect.Rect(float, float, float, float)’ has some invalid arguments
error CS1503: Argument #1' cannot convert
double’ expression to type `float’
error CS1502: The best overloaded method match for `UnityEngine.GUI.Label(UnityEngine.Rect, string)’ has some invalid arguments
error CS1503: Argument #1' cannot convert
object’ expression to type `UnityEngine.Rect’