Gravtiy/Tilt motion on Android device is twitching and very sensitive, is there a way to smooth this out?

Yes. You can make it smooth.

After over a year of improving the results myself over the course of the project, but never quite solving the twitchy problem, a new advisor to our company, who is an expert gameplay engineer, came up with an elegant and perfectly effective dampening algorithm. It really works.

I’ve experienced a lot of heartache with tilt on mobile, trying to make it to actually be smooth, and I’ve seen many others here that have tried and failed as well… so here is the real, actual solution:

This fires off every frame. You can either power it with Tick, or with a looped Timeline. I recommend using a looped Timeline, so you can turn it off/on at will. Tick in Blueprints seems to impact performance more than Timelines, at least as far as my testing has revealed.

Here’s what’s happening:

  1. Mobile Tilt Input is being received from the hardware, whether that’s Gravity, Tilt… whatever. It handles a single axis value. Before setting it previous to this algorithm, do whatever multiplication you need to do to expand the range of motion in your game relative to the device’s motion.
  2. Tilt Array contains 5 array elements as default. This algorithm stores previous frames and averages them for a final output. The amount of array elements you have it set to will determine how many previous frames are stored in the array. 5 works just fine, but feel free to play around.
  3. Tilt Array Index is used to change what element in the array the current frame’s value is being stored in.
  4. After setting the array element, increment the array index, and then modulo the resulting index with the length of the array. What this does is reset the index back to 1 if the most recent array element that had a stored value was 4 (5th element), or whatever your max is. If not, it simply lets it increment and moves on.
  5. Last Index of the ForLoop is set to the highest array element, so array length - 1.
  6. Loop body adds up all values of the array.
  7. On completed, divide Tilt by the array length (5, or whatever you want) and output final value.

TL;DR version:
Store previous frames and average them. Make sure Tilt Array has 5 array elements as default, or whatever amount you wanna try. Just do 5 first.

Try it out and be happy.