[HELP] I have a Timeline with a function for my slide, but it is still Frame-Dependent

Hey everyone, I try to make a slide using a timeline but it always results in something frame-dependent. If I slide with 60 frames/s, I go way less far than with 300FPS. Here is my timeline and blueprint, please help :confused:


Timeline + Function


Inside the timeline. There is a function so it should be time-dependent.


Inside the function. I already try to disconnect almost everything, except the “Set Velocity”; it is still frame-dependent.

The problem is, you’re sampling values during the timeline. You’ve basically taken a load of frame rate dependent code and hidden it in a function, and called that from a timeline. That won’t make it frame rate independent :slight_smile:

Having said that, I don’t actually know what you need to do to fix it. Apart from fixing stuff just for the duration of the TL.

2 Likes

But when I try to disconnect everything except the “Set Velocity”, it is still frame-dependant

If you set the Timeline to 3s, it will keep firing Update for 3s regardless of the framerate. If you:

The TL will move the actor from A to B over its set duration. And it does not matter if you run at 10 or 100 fps. The translation will be either jerky or smooth; the distance and time will stay the same, though.

But, since we have a varying number of frames to work with, the Update will be more or less frequent. In your example, you’re forcing the TL to become somewhat frame-dependent.

With more frequent updates, the movement comp receives new velocity earlier and more frequently, and is also able to process it at the end of the frame - I’d expect to go further at 300 fps than at 60 here. If you want to use the TL like this, you’d still need to multiply the result by frame delta:

image

And then crank up the slide force to keep it inline with the desired gameplay effect.


in short: the TL Update fires as often as Tick, more frames = more ticks = more Updates = more interpolation data. Seems like it’s critical in this use case scenario. Hope I’m reading this correctly.


What is really frame-independent is a Timer. If you set the Time low enough, it will happily fire in between the frames. One note - the Timer’s updates are not distributed evenly in the same frame afair.

3 Likes

Wow, thank you for your complete answer.
I tried to add a pin in my multiplication and add World Delta Second as you said. I set up my Slide Force to counterbalance the effect.

And it still not working, it is making the inverse effect: more FPS = less speed and distance
:frowning:

I am under the impression that the main issue here is trying to override the velocity of the component rather than having it do what is needed. It’s somewhat similar to setting velocity of a simulation and expecting it to simulate correctly. It might, it might not.

What if you swapped it for Add Movement Input instead? Could that work? Here’s what I mean:

image

This would produce consistent frame independent results (thanks to the Movement Input doing its magic). Essentially, we ask the comp to move faster but it can still make its own calculations.

You can still work in the curve and the direction, but perhaps the curve should affect the Max Acceleration and / or Max Walk Speed if the TL’s track → Scale Value does not provide enough granularity and control over the movement feel - I believe this is worth experimenting with.

It works, thank you so much <3

1 Like