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:

http://.ms/18iakeu

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?

Thanks,

Howdy ,

Thank you for reporting this issue. I have just tested this out and have been unsuccessful so far with a repro. Would you be able to provide any steps that I could use to reproduce this issue internally? Is this issue still occurring on 4.7.2?

Any additional information regarding this report would be greatly appreciated.

Thanks and have a great day!

I wasn’t aware that 4.7.2 was out. I’ll have to try that. Other than that I just have a blueprint that is streamed in and when the begin play fires off I have an EnableInput node along with a Tick event to pull the Tilt and/or GetTilt. Make sure your game is set to only allow portrait and make sure you close down the game COMPLETELY before launching it again w/it rotated.

Howdy ,

I have tried to repro this issue once again and have been unsuccessful. I have been closing the project completely before launching a second time.

Would you be able to share a sample project with me so that I may be able to reproduce this issue internally? You can share a project with me privately via the forums. You can find my forum page here: https://forums.unrealengine.com/member.php?4890-Sean-Gribbin

Thanks and have a great day!

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.

Hello ,

I see that you posted your last comment as an answer and it sounds as if you have solved your issue. I am going to mark this issue as resolved. If this is not the case please feel free to reply back and I will be more than happy to assist you further. However, I would also like to note here that I put in a report for the 90 degree offset between iOS and Android.

Make it a great day