someone can tell me how can I reset my accelerometer. I have a 3D environment, and my ball bounce left-right correctly, my Y is ok, I don't need it, but my z is not ok, I use my device in landscape mode. Pratically when my devide is 90° (landscape mode) with the floor is in neutral z position. I need to have neutral position when user start game, I see other answer on unity blog with they don't work for me. This is my code :
public float posZ;
// Use this for initialization
void Start () {
Salvataggio.control.Load ();
posZ = Input.acceleration.z;
}
void Update () {
trovaPallina = GameObject.FindGameObjectWithTag ("Pallina");
if (trovaPallina) {
trovaPallina.transform.position += new Vector3(Input.acceleration.x / 10, 0, (Input.acceleration.z - posZ) / 10) ;
}
}