I have a first person tunnel game where the player is always in forward motion. When I play the game on the PC or the Web, I control movement by moving my mouse back and forth to rotate the camera 360 degrees around the z axis. When I play the game on the Android phone, I can only move the main player(rotate on z axis) by touching the screen of the phone.(it does this automatically, I didn’t script it that way) I don’t want to control the player movements by touching the screen, I want to move the phone to control the player. Can someone point me in the right direction? I don’t even know where to start.
Thanx
Here is my rotation script which is attached to my Main camera. I have a child object attached to the camera which is the main player object.(Sphere) When I move the mouse the sphere moves with the camera as it rotates 360 degrees. What commands do I need to add to this script to fix this problem? thanx
// Performs a mouse look.
var horizontalSpeed : float = 2.0;
var verticalSpeed : float = 2.0;
function Update () {
// Get the mouse delta. This is not in the range -1…1
var h : float = horizontalSpeed * Input.GetAxis (“Mouse X”);
var v : float = verticalSpeed * Input.GetAxis (“Mouse Y”);
transform.Rotate (v, 0, h);
}
thank you.....
– DFiable