- Home /
error CS0246: The type or namespace name `rect' could not be found.
This is a piece of the script.
void OnGUI()
{
int shotsLeft = shotsMax - shotsFired;
GUI.Label(new rect( 10, 30, 40, 40), shotsLeft.ToString() );
}
But now he gives error: Assets/Scripts/shootBlock.cs(49,15): error CS0246: The type or namespace name `rect' could not be found. Are you missing a using directive or an assembly reference?
Its like he can't find rect. Can anyone help me?
Thank you, Thomas.
@$$anonymous$$ you did upvote.. but you also have to accept the answer.. the little tick right bellow the voting thing :) more info: http://answers.unity3d.com/questions/1086/how-can-we-as-users-get-the-most-out-of-unityanswers
Answer by duck · Apr 01, 2010 at 11:49 AM
You need a capital R for "Rect".
See this answer for more information: The Rules of Capitalization in Unity
Thank you very much for your fast anwser! It works now.
No problem. Remember to use the voting & 'accept answer' tick icon. :-)