- Home /
Question by
Aliyaan · Aug 01, 2016 at 02:50 PM ·
javascriptuce0001semicolon
js(9,31): UCE0001: ';' expected. Insert a semicolon at the end.
I'm new to Unity, can anyone please help me, I have tried everything.
#pragma strict
var rotationSpeed = 100;
function Update ()
{
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
GetComponent.<Rigidbody>()rigidbody.AddRelativeTorque (Vector3.back * rotation);
}
Comment
Answer by Landern · Aug 01, 2016 at 02:51 PM
You're missing a dot/period when accessing the Rigidbody types rigidbody property/field.
Wrong:
GetComponent.<Rigidbody>()rigidbody.AddRelativeTorque (Vector3.back * rotation);
Right:
GetComponent.<Rigidbody>().rigidbody.AddRelativeTorque (Vector3.back * rotation);
Answer by Ruben_Chris · Aug 01, 2016 at 02:53 PM
You are missing a "." before rigidbody.AddRelativeTorque.