- Home /
Gyroscope.attitude = GetComponent ().TransformDirection ?
My gyroscope isn't working properly, so i want to re-write Gyroscope.attitude based on local axis of an object. The object has definetely right axis, so if i will use it, gyroscope should work properly.
Is it possible and how? I am trying something like
Gyroscope.attitude = GetComponent<Transform> ().TransformDirection;
or
Gyroscope.attitude = GetComponent<Transform> ().InverseTransformDirection;
Yet not sure. Is it possible that way?
Answer by fffMalzbier · Sep 18, 2015 at 07:57 AM
You can not overwrite the input form the hardware side, but you can make a wrapper class that you can put in between.
Hardware data -> Wrapper class (corrects / transforms / replaces the incoming data to your will ) -> end use of the gyro data
Instead of using the gyro directly in your script you have to use the wrapper class.
Can you give me an example how to do so?
Wrapper class = input.gyro.attitude something?