Download

Ideas for simulating gravity arc over a specific amount of time?

Previously I had a gravity arc(see photo for example) setup using Event Tick, and it worked fine. However, I noticed over various devices the rate of which gravity was simulated varied – I assume because I was running checks per tick.

To resolve this I’ve been moving many event tick related methods to Timelines to ensure a balanced experience across all devices.

Overall the transition has been moving smoothly but I’m having problems generating a gravity arc using timelines. The focus is to move the actor in the direction in which it is flung(mobile touch) while losing X and Z velocity.

Here’s working code using event tick. I just can’t figure out how to get this into a Timeline.

Example of how an actor might fall. X will gradually decrease for a more realistic fall, but X should never cause the arc to fold in upon itself. Modifying X is not as important as the Z. I’m sure once Z is figured out X will be easy with some clamping.

Determine moving direction and velocity by comparing the actors last location to it’s current:
ee23b3ceb79f2233c9e8286524abe95f3470273d.png

Per event tick move the actor along it’s Moving Direction path, and lower the Z(height path) value after each move. This will generate a smooth arc:
77307a099782bec13dcde29edbeb60c304833f31.png

Got a solution. Bit hard to explain in writing so if anyone needs feel free to PM.