# Timeline movement affected by framerate?

**URL:** <https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561>\
**Category:** Blueprint\
**Tags:** Frame-Rate, timeline, framerate, ue4-editor, unreal-engine, question\
**Created:** [October 17, 2024, 11:59am UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561 "2024-10-17T11:59:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 11:59am UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/1 "2024-10-17T11:59:40Z")

</div>

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)?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 12:27pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/2 "2024-10-17T12:27:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 12:34pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/3 "2024-10-17T12:34:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 12:41pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/4 "2024-10-17T12:41:35Z")

</div>

> [@CLiolios](#):
>
> So whats the difference to using tick?

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.

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 12:42pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/5 "2024-10-17T12:42:21Z")

</div>

Its for gravity, mainly

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 12:45pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/6 "2024-10-17T12:45:20Z")

</div>

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](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/5/ed58625801360b15172e7a6f8c1ad21a64b3b270.png)

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

* * *

To clarify what I meant by:

> [@Everynone](#):
>
> 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.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/5/aa543d4bb3174325857feaf66f3921d3706eaebe.png)

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 12:56pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/7 "2024-10-17T12:56:33Z")

</div>

- 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 😁

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 1:01pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/8 "2024-10-17T13:01:45Z")

</div>

- 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?

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 1:02pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/9 "2024-10-17T13:02:40Z")

</div>

close enough

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 1:08pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/10 "2024-10-17T13:08:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 1:09pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/11 "2024-10-17T13:09:55Z")

</div>

I use a box trace

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 1:10pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/12 "2024-10-17T13:10:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 1:13pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/13 "2024-10-17T13:13:07Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 1:20pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/15 "2024-10-17T13:20:43Z")

</div>

here’s the blueprint if it helps  
[Test posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/a-aab-ns/)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/16 "2024-10-17T13:35:49Z")

</div>

Got it. How about this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/3/2737cbc544af6b87a46e0be6f8b4ac204021deb4.png)

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:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/b/63b70ad8ae3090bee61f52eeb0a02c6c95d49a75.png)

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 1:40pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/17 "2024-10-17T13:40:37Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/2/f02ecfb1d015af238e7690e0b1742295d06c4ef0.png)

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.

---

<div class="post-metadata">

**Author:** ![CLiolios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CLiolios](https://forums.unrealengine.com/u/CLiolios)\
**Post date:** [October 17, 2024, 2:03pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/18 "2024-10-17T14:03:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 17, 2024, 2:16pm UTC](https://forums.unrealengine.com/t/timeline-movement-affected-by-framerate/2072561/19 "2024-10-17T14:16:44Z")

</div>

> [@CLiolios](#):
>
> I want to implement moving platforms

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