code:
#pragma strict
var RotationSpeed = 100;
function Update ()
{
var rotation : float = Input.GetAxis ("Horizontal") * RotationSpeed;
Rotation *= Time.deltaTime;
UnityEngine.Rigidbody AddRelativeTorque (Vector3.back * Rotation);
}
error:
Assets/BallControll.js(10,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
umm where to i put the semicolon that unity is asking me to again?
I’m pretty sure you want something like this:
#pragma strict
var RotationSpeed = 100.0;
function FixedUpdate()
{
var rotation = Input.GetAxis ("Horizontal") * RotationSpeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque (Vector3.back * rotation);
}
Note: You had used “Rotation” (with a capital “R”) but your local variable was called “rotation”. Also when dealing with forces you should use FixedUpdate.
UnityEngine.Rigidbody; AddRelativeTorque (Vector3.back * Rotation);