Hi, for some reason i am getting this error and i don't really know how to deal with it. My gas and brake buttons are made by selecting it and creating other --> guiTexture. I did this though the unity program.
foreach (Touch touch in Input.touches)
{
if (Gas.HitTest (touch.position))
{
Debug.Log("Clicked the button - Gas");
}
else if (Brake.HitTest (touch.position))
{
Debug.Log("Clicked the button - Brake");
}
}
***CarMain.cs(96,29): error CS0103: The name `Gas' does not exist in the current context***
***CarMain.cs(100,34): error CS0103: The name `Brake' does not exist in the current context***
I am guessing i have to define Gas and Brake, but how would i do that if they are made through inspector. Any help would be appreciated.
↧