Hello
I am fairly new to Unity. Im working with the OnGUI controls but have been running into problems. Heres my code
function OnGUI()
GUI.Button (Rect (560,25,140,35), CameraView)
;
{
if(CameraView < 7)
(CameraView++);
else
var CameraView = 1;
}
(GUI.Label (Rect (20,40,140,35), "Speed: " + Speed + " MPH")
// Displays "Speed: -- MPH.".
);
I have already made the variable before in the class and this is just the OnGUI side of the code
For some reason it comes up with the error “BCE0043: Unexpected token: GUI.”
Im sure that its just something simple but ive looked around the internet and unity answers but havent been able to find exactly the solution
Any help will be appreciated
Thank You
P.S. CameraView and Speed are variables. Also this is written in Javascript
Thank You very much It turns out it was something simple CameraView was actually already declared at the top of the page and I dont think the extra brackets were causing any problems but thank you it turns out it was the if, and lack of { and } Thank you very much
– Dok101