SO im trying to test this
var Rotationspeed = 100;
function Update () {
var rotation : float = Input.GetAxis ("Horizontal") * Rotationspeed;
rotation *= Time.deltaTime;
UnityEngine.Rigidbody();
Rigidbody.AddRelativeTorque (Vector3.back * rotation);
BUT I GOT LIKE ONLY 1 FREAKIN ERROR AND ITS FUSTRATING ME.
it says an instance of type ‘UnityEngine.Rigidbody’ is required to acess non static memeber ‘addrelevativetorque’
HELP
ive literally got rid of every other error but that one
yoda12
3
@Headkill1
Try this
var rb: Rigidbody;
function Start() {
rb = GetComponent.<Rigidbody>();
}
var Rotationspeed = 100;
function Update () {
var rotation : float = Input.GetAxis ("Horizontal") * Rotationspeed;
rotation *= Time.deltaTime;
rb.AddRelativeTorque (Vector3.back * rotation);
}
From Unity - Scripting API: Rigidbody.AddRelativeTorque