Hi,
While playing around with Unity Remote, to control my game with my iPad, I noticed that the gyroscope doesn't work. This sucks, so I tried to find a solution. I found one from the guys of Quick Fingers, though it needed some tweaks, so I'm writing an updated version here. You can read the original tutorial here, mine will be shorter and more to the point.
Needed Soft/Hardware
- Unity3D and a mac
- An iOS device with Gyroscope (any new iPhone, iTouch or iPad)
- Control for iOS
- Osculator (trail, 20second wait every 10minutes)
Steps
- Install and start Osculator and open the QuickFingers file
- On your iOS device open Control, in 'Interfaces' add a new one and enter this URL: http://www.quickfingers.net/unitygyro/layout.js
- In Unity setup your Input Settings like this:
- Now you can use this in Unity, here's how to convert it to a quaternion:
float gyroX = Input.GetAxisRaw("GyroX") * 360.0f;
float gyroY = Input.GetAxisRaw("GyroY") * 360.0f;
float gyroZ = Input.GetAxisRaw("GyroZ") * 360.0f;
Quaternion rotation = Quaternion.Euler(gyroX, gyroY, gyroZ);
Now you can use rotation as the rotation of your camera yo create a window into your game. Kind of, since no image is send to the iPad... Still, it's great for testing and a lot of fun!
