Timeline broken when using movement to self ?

Hello,

So I first posted my problem on the VR section because I thought it was VR related but it’s not at all : DoOnce not working properly - XR Development - Epic Developer Community Forums

You can follow the link if you’re curious or want more informations but I will try to explain better here.

Besically if I use a timeline to an object in the world (in the level blueprint) there is no problem.

If I use the timeline in a class blueprint to move the object of the blueprint, it doesn’t work correctly. The first time it is triggered, the timeline is played too many times and after the first time the timeline is done once but I don’t think it’s correct either because the movement seem too fast. Also I just discovered that it is related to the frames per seconds.

4 differents gif of the same object triggered so you can see :


As you can see, each time it goes to a different location, it depend of the fps I have.

Now what happen after the first trigger :


This movement should be done in 2 seconds and not like this.

The timeline :


move 10y in 2s

The blueprint :


Don’t screem yet at me, this is the last thing I tried but I tried every set/add location possible, all the relative, world, local and actor so I’m 95% sure this is caused by the timeline and not the location, if you want to see some exemple of what I tried to do you can follow the first link.

The object :


I tried anything that I could think of, it doesn’t make sense to me.

The main problem I see with your setup is that you probably want to use “Play from Start” on your timeline instead of “Play”. This will make it play from the beginning of your curve every time. You can also put a Bool in there that will make it so you cannot trigger it again until the timeline has finished.

Also, just so you know, the “Update” output of a timeline is triggered every frame while the timeline is active. In your example, every frame for 2 seconds at 60 frames per second, it will trigger 120 times. This might be causing what you are seeing when your framerate is different.

There is probably a better way to achieve the behavior you want, but I’ll have to wait until later tonight to show you some examples.

[=]
The main problem I see with your setup is that you probably want to use “Play from Start” on your timeline instead of “Play”. This will make it play from the beginning of your curve every time. You can also put a Bool in there that will make it so you cannot trigger it again until the timeline has finished.

Also, just so you know, the “Update” output of a timeline is triggered every frame while the timeline is active. In your example, every frame for 2 seconds at 60 frames per second, it will trigger 120 times. This might be causing what you are seeing when your framerate is different.

There is probably a better way to achieve the behavior you want, but I’ll have to wait until later tonight to show you some examples.
[/]

Another problem you may run into with your current setup is you are continuing the timeline after the intended end. Make sure to “Use Last Keyframe” within the timeline to prevent the timeline from assuming a much longer timeperiod than intended.

@DSursely : Play from start doesn’t change from Play in my case (only the second time I trigger will change)

@ : Use Last Keyframe doesn’t change either in my case, I make sure it was checked in most of my tries.

So I think I finally found how to do it, basically I was doing this :


But the correct way is this :


Thank you for your help.

Yep, this was going to be one of the examples I would show you later today. Good job!

The only reason I was suggesting “Play from Start” was so it would react the same on the second time, which I thought was one of your problems.

Glad you figured something out that works.

Play from start is indead the right thing to do now that the first trigger is working well, thanks :slight_smile:

Weird that none of the people (including myself) commenting in your previous thread spotted this rather obvious error. I guess we were all too focused on the more directly timeline-related errors.