I decided to make a script setting the rotation on the y axis of the cube to mouse x. When I run the script it says:
here is the script:
var rot = Input.GetAxis("Mouse X");
var min = 0;
var max = 0;
function Update () {
// if lower than max higher than min
if rot < max; and min < rot; {
// set rotation on the y axis to mouse x
transform.rotation = Vector3(0,rot,0);
}
}
Hmm, I wouldn’t mind an answer. I would like to be able to start debugging well. By the way, I believe this is javascript, am I right? I couldn’t exactly tell because the if didn’t have brackets after it. ex:
You need brackets around the condition part of an ‘if’ statement. Also, the semicolons in the condition shouldn’t be there and the ‘and’ operator is actually written as in JavaScript.