Android tilt calibration

Hi there,

I am very new to UE4, I’ve been using it for two weeks. (Blueprints only as I am no programmer) I apologise if this post is in the wrong section, as it might not only be for Android.

I am trying to get Tilt to work on Android - to control the movement of a rolling ball. I have managed to set it up and it is working. However it seems like the calibration of the gyroscope is way off. I created a print string to see the rotation values of the Tilt.

If I start the game with my phone flat on my desk the values are roughly X-3.1 Y-0 Z-3.1

As a result of this controlling the ball is almost impossible. If I turn the device upside down (by holding it above my head) then the values are much closer to zero.

I came across the Calibrate Tilt function and assumed that this would zero out the Tilt values. I’ve tried to incorporate it into the blueprint and I even tried to create a button/widget that calls the function. Unfortunately it isn’t doing anything - No change to the values at all.

Am I doing something wrong? If anyone has any insight as to how to zero out the Tilt Values/Calibrate Tilt that would be amazing.

I tried calibrating my phone (Samsung Note 3) But from what I can see, Samsung have done away with a manual calibration function in the motion device settings.

Much thanks!

Damian

From what I have seen, the best way to do it is to create a Vector that will keep a given orientation as the “Zero” orientation. Then you can substract this “Zero” vector from the Tilt Vector you receive.

EDIT: you can also look at Shasta solution, you may indeed experience problems when your tilt values directly jump from PI to -PI, in particular if you are smoothing these values