i was working on a basic 3d platformer as a tutorial but i'm getting the error in mono:
Assets/Ball Control.js(11,19): BCE0020: An instance of type 'UnityEngine.Rigidbody' is required to access non static member 'AddRelativeTorque'.
the code i was using is:
pragma strict
var rotationSpeed = 100;
function Update ()
{
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
Rigidbody.AddRelativeTorque (Vector3.back * rotation);
}
Can anyone help me
↧