Custom C++ movement

I have some very simple but very custom collision requirements. Its likely I could force them through the physics system but it’s going to be a lot of work and I don’t need the complexity.

To get smooth movement I’m applying velocity through AActor. I tried updating positions manually in Tick but found it jittered - my guess being that Tick is decoupled from visual framerate.

Seems like one of two options would be great - but I haven’t found them yet:

  1. Some “PostMovement” callback on the AActor

  2. Forcing the Tick events to operate every frame. My logic is pretty light and this should be viable.

Any help out there?

Tick is executed on every frame, you probably forgot to scale changes to DeltaTime. DeltaTime contains estimated time between frames, if you multiply change (delta) by it the delta value will become something/s

Delta time was in there. Sometimes it looked smooth, but then it would get jitters as if Tick were being skipped some frames and potentially caught up later (double step next frame). The effect was subtle but also disconcerting.

Last time I tested this was a few versions back - easy enough to test again though…

Looking at my code another potential cause is apparent - if the order between my AAGameMode Tick and the actor Tick was variable the skipping frame/ double frame behavior would be exhibited - because my game mode tick is driving the simple physics.

And that wasn’t an issue, because I’d moved all my updates into the gamemode Tick, and without velocity applied to the actor I still see the occasional glitches.

Anyway, experimenting with just using the unreal physics system to see what effect I can get as it might provide me with some more interesting gameplay options in the future.

I’m going to mark this as an answer to my original question, but it won’t work for everyone:


1) Some “PostMovement” callback on the AActor

Use SetTickGroup to order updates. In my case I can push my game mode update after the actors updates and therefore manage a PostMovement call back myself.