I currently am designing an app that tweens a unity camera around the screen, both positionally and rotationally. At one point, when the user goes to a specific location, I want them to be able to look around the scene through their iDevice using the gyro. I have this working fine. The problem is that the unity camera snaps to whatever position Input.gyro is returning on update. I know this is because I am setting my current transform.rotation to the attitude on the gyro on every frame. What I want to happen is whatever position and rotation the unity camera is at, I want to be the starting point for the gyro. So lets say I get into a car and I’m in the drivers seat, i want the camera to start looking out the windshield and then if the gyro turns right, turn to the right. Right now it rotates to the drivers seat and looks out the windshield, but as soon as the tween is over, it snaps to the gyro. So if the gyro is looking down and right, I go from staring out the windshield to looking at the cupholders in one frame. What I would want to happen in that situation is for this down right position of my iPad to be the looking straight out the window position of the unity camera, and then any adjustments from there are offset from the “looking out windshield position.”
Hope this is clear and not ultra confusing. I have the gyro working just fine, I just want whatever position the gyro is in when i start checking its attitude to be a stock position/rotation for a unity camera, and then as I move the iDevice it moves the camera relative to the stock position/rotation. Right now it’s not, I’m looking at the true gyro of the device. I don’t know enough about Quaternions or the Input.gyro to really know where to begin. Any advice? Has anyone implemented something like this before? Any Quaternion experts out there?
Thanks.