- Home /
Why is this giving me an error?
Ok so I made this script about five minutes ago but I cant for the life of me figure out whats wrong with it. Unity says it is expecting a colon instead of an =. I don't know how that would make any difference. It might be capitalization because I am used to C and C doesn't have capitalizing in it so you don't have to worry about it which is very nice. Without further to do here is my code:
var rotatespeed = 1; function Update () {
if(Input.GetButtonDown("Vertical"));
{
Transform.rotation.x = 1 + Transform.rotation.x;
}
}
thank you
C code is case-sensitive. It has capitalization in it if functions or variables are named that way, exactly the same as C# and JS.
Answer by xniinja · Apr 07, 2011 at 03:30 AM
Figured it out. ; after if statement FacePalm
Just some further hints: "`Transform`" is a class type and "`transform`" is the class instance of this GameObject. rotation.x is just one of the 4-dimentional representation of this rotation. It's NOT the eulerangles you see in the inspector. The 4 members of rotation should not be changed manually, use a function like .Rotate()
Your answer