Gravtiy/Tilt motion on Android device is twitching and very sensitive, is there a way to smooth this out?
Basically I have just started using UE4 and getting use to this amazing blueprint stuff. I'm testing out camera controls by the orientation of an android mobile device to look around a 3d enviroment or to change the rotation of an object by at least 180 degrees on each axis. It sort of works but as you hold the device the camera movement is very sensitive with a random twitching glitch.
I have tried methods from older answers and have so far come up with this current blueprint below:
It tries to reduce sensitivity but it is also restricting movement. The crazy twitching is probably caused by this blueprint so i know I made a mistake somewhere.
Any way to do this better?
asked Apr 20 '16 at 06:23 PM in Blueprint Scripting
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:
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.
I was implementing exactly the same solution as described by DG Gage but an "average" by definition is always affected by the extremes of the data that means that if at any moment you get an erratic value your whole array "history" is affected for example 1,2,2,30,1 then you get a bad movement until the history removes the "30". There is fashion/mode (maybe i am translating bad, my native language is spanish) wich gives you the most repeated value from your data so i implemented it and got nice results by combining it with average
answered Apr 14 '17 at 06:16 AM
Couldn't you just use the axis value of the Rotation Rate rate event directly?
answered Apr 20 '16 at 06:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here