- Home /
Rotation of an object to match phone rotation with torgue
Hello guys,
im trying to implement a way to rotate a ramp with the rotation of an mobile phone. For desktop controls im using this solution:
if (Input.GetKey(KeyCode.LeftArrow)) rbody.AddTorque(0, 0, speed*20);
if (Input.GetKey(KeyCode.RightArrow)) rbody.AddTorque(0, 0, -(speed*20));
I could easily get the rotation from the gyro class but then i don´t have the angular velocity that i need to get the right physics for my game.
I hope somebody has an solution for that and can help me.
Thanks alot Rassler
Comment