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.
None, but using a Timelinefor 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.
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:
I’d base handling gravity around this. Maybe. Depends on the details.
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?
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.
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.