Hello, all.
I have a question, i have this script:
var xForce : float = 10; var yForce : float = 10; var zForce : float = 10;
var rotationRate: Vector3;
function Update () {
if (Gyroscope.rotationRate(1,0,0))
rigidbody.AddForce(Vector3(0, 0, 10));
if (Gyroscope.rotationRate(0,1,0))
rigidbody.AddForce(Vector3(10, 0, 0));
if (Gyroscope.rotationRate(-1,0,0))
rigidbody.AddForce(-Vector3(0, 0, 10));
if (Gyroscope.rotationRate(0,-1,0))
rigidbody.AddForce(-Vector3(10, 0, 0));
}
but unity gives this error:
Assets/scripts/marble controle (gyroscope).js(7,27): BCE0020: An instance of type ‘UnityEngine.Gyroscope’ is required to access non static member ‘rotationRate’.
What does this mean? (I’m new to scripting in unity)
I really don’t know what i have to do.
Ty, already.