4.7 GetTilt bug or need to force a reinitialize?
So our iOS game is set to portrait mode only. However, we still have to query the devices tilt for certain screens. We don't want the entire game to rotate, just specific ui pieces. For our initial test case it seems to work OK.
I hold the device straight up prior to launching the game. When the game is launched we grab the current rotation like so:
The rotation displayed is around (P=0,Y=0,R=0). As I rotate the device to the left it centers around (P=-45, Y=-90, R=0) and when I rotate it to the right it will center around (P=45, Y=90, R=0).
Using that information I'm simulating a rotation on some of our UI objects based on the Yaw. (-20 to +20) is the default, while (-100, -80) represents left and (80,100) represents right.
Now, our second test case which fails goes as follows. Close the game completely, rotate the device 90 degrees to the left (so it is horizontal). Launch the game. Remember the game is set to only run as Portrait so the user will naturally rotate the device to see it. The issue though is that the game somehow initialized the tilt information prior to device being rotated by the user. So when the user rotates the device to look at it the rotation is no longer around (P=0, Y=0, R=0) but rather (P=0, Y=45, R=0). Rotating it to the left centers it around (P=90, Y=90, R=0) and to the right centers it around (P=25, Y=90, R=0) which is a bit more baffling..
So, how can we tell the engine to re-calibrate while the user holds it straight up or how can we compensate for this situation in general?
asked Mar 03 '15 at 03:54 PM in Bug Reports
I will try to get you something. I ended up using gravity as the values were consistent. Also this was on my iPad, not in the PIE. Thank you for investigating.
answered Mar 07 '15 at 05:59 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here