Hello, all.
I have a question, about a script with a gyroscope.
I have this script:
var xForce : float = 10;
var yForce : float = 10;
var zForce : float = 10;
static 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 a error:
Assets/scripts/marble controle (gyroscope).js(15,15): BCE0020: An instance of type ‘UnityEngine.Gyroscope’ is required to access non static member ‘rotationRate’.
What do have to do with it?
Ty, already.
[Edit by Berenger : I formatted you code properly, but line 15 might not be relevant anymore.]