Timeline movement affected by framerate?

I am using AddWorldOffset in a looping Timeline to move an actor.

I am using a timeline, because I know it’s supposed to be independant from the framerate, but when I fix the framerate to 30fps, for example, the movement gets slower.

Is there some option I’m missing? Or do I stll have to compensate with delta time (or something simmilar, since timelines dont have delta)?

Timeline’s Update fires every frame; more frames = more frequent updates. If you were using a track and Lerp, you’d get adequate number of interpolation steps. However, using just Add World Offset omits interpolation which would otherwise make the calculations frame independent. That’s unless you have a more complex setup, ofc.


Sounds like you’re forcing the timeline to execute code in a time-dependent manner, in which case you’d need to multiply the calculations by delta time.

Or use a Timer, or set Tick to a fixed value.

1 Like

I didn’t know that…Thanks
So whats the difference to using tick?

Anyway, what would be the alternative that is not just AddWorldOffset ?
Or, how do I apply interpolation to this?

None, but using a Timeline for this is more expensive because we must now also pay the cost of the Timeline component. It Ticks every frame on top of the usual Tick.


Or, how do I apply interpolation to this?

What is this? What kind of movement is this supposed to be? Are you moving a chess piece from B2 to B3? Timeline is perfect. Are you applying Dash super power to a character? Timeline could work but there will be things to consider - like delta step.

1 Like

Its for gravity, mainly

In order to suggest something, we’d need to know more. I’d hate to send you the wrong way.

  • gravity of what?
  • why use timeline for gravity?
  • does the gravity shift (?) last for x seconds?
  • why even use Add World Offset for gravity? (you may have your reasons)

What I sense, but might be completely wrong, is that you’ve chosen a set of tools that is not suitable for the task at hand. There are things that the TL is great for, there are scenarios where the TL makes no sense whatsoever.


For example, there’s:

image

I’d base handling gravity around this. Maybe. Depends on the details.


To clarify what I meant by:

  • The gravity is of objects the player can move
  • I tried using timeline hoping to avoid framerate dependancy, which seems to not help after all
  • The gravity is constant (set to 0 when on ground). One of the objects can also be launched forward.
  • AddWorldOffset seemd like the most straightforward way since I dont want to use physics for this

The game is a top-down zelda-like, and the objects in question are the “pots” and pushable blocks

Thank you for taking time to answer this btw :grin:

1 Like
  • we grab an object, lift it up
  • move it elsewhere, let go
  • it has to come down due to gravity
  • but we need to fake gravity since there’s no physics?

How close am I?

close enough

1 Like

One last question, since you’re adding world offset to emulate gravity, how are you handling collision with the ground? How do you know when to stop moving the pot in order to prevent intersections?

I use a box trace

So you keep tracing every frame (either tick or TL) and when distance reaches a threshold, we stop the timeline?

I was using tick and seting gravity scale to 0 when there was a hit
I could probably replace this with a box collision and onBeginOverlap…

(post deleted by author)

here’s the blueprint if it helps
Test posted by anonymous | blueprintUE | PasteBin For Unreal Engine

Got it. How about this:

Could that work here?


  • no tick, no actual timeline, no physics, a single event based trace (switch to box trace if necessary), and since we’re using time, we couldn’t care less about frame delta. Aka, Poor Man’s Timeline.

And here’s another, dramatically simplified way:

If we’re allowed to Tick and Sweep, things get trivial. Just Open the Gate.

So this is how you stop. Sweeping would also work, ofc, but it’s expensive, and would need to be done every frame, and account for frame time. The cost may be irrelevant, though.

1 Like

This could work, since right now gravity needs to apply only after a player action, so I know when to call the event

However I realized that if I want to implement moving platforms neither of theese would work

So probably I will need to rethink my approach from the start anyway

Attach to pot to the platform it landed on? But yeah, hence me grilling you on the details :innocent: - there’s always something extra to consider.