Input.gyro.enabled is always False, even when running on
an Android phone equipped with a gyroscope.
What is required to activate the gyroscope for input?
Input.gyro.enable = true;
doesn’t improve things.
Input.gyro.enabled is always False, even when running on
an Android phone equipped with a gyroscope.
What is required to activate the gyroscope for input?
Input.gyro.enable = true;
doesn’t improve things.
Had the same problem when getting started with android. Try using the accelerometer instead for your inputs. There actually is no “gyro”, it is an accelerometer chip. Heres a little test you can do
var dir:Vector3;
var style:GUIStyle;
function Awake()
{
style=new GUIStyle();
style.alignment=TextAnchor.MiddleCenter;
style.normal.textColor=Color.red;
}
function Update()
{
dir=Input.acceleration;
}
function OnGUI()
{
GUI.Label(Rect(Screen.width/2-100,Screen.height/2-100,200,200),dir+"",style);
}
I added a style to the label so you can more clearly read the values the accelerometer is outputting.
Thanks for your succinct answer; I’ve also figured out that I must write a function
based on the accelerometer.