Damping the steps

I’m making a very simple system to damp the steps up/down by compensating for the translation of the mesh.

It works, but the system enters a frame late, and during that frame the mesh is up, and then down in the next frame.

The way to do this is to save the last location at the end of the tick, and then compare the current location with the saved position. If the difference of z is greater than a threshold, I apply the translacion, which is then returned to the start using interpolation.

I have tried all 3 types of tickgroups but without results. Is there any way to make this work?

Here the video showing the problem:

check how UpdateEyeHeight does it, which is called from TickSpecial btw

I made such a system recently as well. I override UpdateEyeHeight but in a more smooth fashion. I found I needed to save 5 frames worth of Z position to make it smooth enough :slight_smile:

Umm… setting bUpdateEyeHeight to true, no event is received… I need to do something more to activate? I’m extending from Pawn.uc and SimpleGame.

Solved, extending from UDKpawn. The damping works perfectly. But the game is slower… there are some way to use some event like this without using UDKPawn/UTPawn?

Nah, I have tested the speed and is basically the same. Years ago I did a test and the gain was the 20%, but perhaps I was using another UDK version.

Thanks for the help, is working fine.

if you call UpdateEyeHeight() yourself from TickSpecial you don’t really need to extend from UDKPawn

After 4 years working with UDK, I didn’t know tickspecial… thanks again, maestro!