• News

• Industries

• Learning & Support

• Community

• Marketplace

# My Timeline have a strange behavior with a Lerp

Hello guys,

I need some help with a timeline I created connected to a Lerp.

Here’s my blueprint :

So as you can see my timeline (5 seconds lengh) is moving my Actor from point A to point B using a Lerp.
From here everything works fine but here is my problem. My timeline is 5 seconds long (Float from 0 to 1) but my actor reaches the location in less than 1 second.

My actor is moving from point A and reaches point B just like it should but everything really fast instead of doing it in 5 seconds. You can see the print node in the picture. Well my actor reach point B in 1 seconds but the word STOPPP displayed at 5 seconds. So my timeline seems to work but the lerp function seems to have a problem.

I did an other test, instead of having a float going from 0 to 1. I changed value and put it from 0 to 0.02. And it works. I mean with that my actor really takes 5 seconds to reach the point B.

So my question is : Why the lerp node is reaching B when the Alpha is only 0.02 instead of 1. I’m starting to become crazy with that. Does anyone have the same issue? or know why this is happening in that case?

Thanks for your help and here’s a screenshot of my timeline node with the workaround :

Hi!

For “begin point” you use absolute coordinate of Actor, but for “end point” you use relative, why? And why you add offset?
For move Actor from begin to end, you just need set in Lerp two absolute coordinates. And Lerp correct blend this two data with alpha from 0 to 1.
I think you need use “Get World Location” for “Component Hit”.

Ok so about the Why, it’s just because I’m a noob and I mix everything with relative, absolute and world location. it seemed to worked like that so I thought it wasn’t the issue.
As soon as I came back home I’ll try that and let you know if this is working.

About the offset it’s just that I trace a line between my actor and the next collision, I get the location of the colliding object but I want my actor to be 250 units before this point (to stay on a virtual grid). So I use this 250 unit offset.

Anyway thanks a lot for your help, I really appreciate your fast answer. I’ll let you know :-).

Sadly I tried to take the world location for both actors (I use print function to see that the coordinates are good and they are) but when I use the set world location for the actor the issue is still here. The actor reach the point B in 1 second.
If you have any other idea I’m open to every possibility.

I can provide an additionnal information here.
When I delete the Timeline and enter the Alpha manually (ex 0.5), the actor is moving to the right place.
So I don’t think there is any issues with the Lerp which seems to work. So I assume the issue is only about the Timeline. My timeline is set to Time:0 Value:0 / Time:5 Value:1 and the result is my actor reach the point in 1 second.

I don’t have any other idea about that, seems really weird.

can you plug a “do once” node in front of timeline and see what happen? also print the value of NewTrack1 right after timeline’s update.
It’s going to generate a wall of messages in your log, but at least you can see what happened.

Hello man, thanks for your help. I tried to put the print in the Update and the NewTrack1 was working fine. From 0 to 1 in 5 seconds. And I finally understand my mistake, it’s really stupid.
For each Update of my timeline I say to move from Y position of my actor to Y position of the wall.

The issue is that the Y position of my actor is updated for each frame of the timeline. Means that the Point A is changing everytime. So I just had to put point A and point B into variables before launching the Timeline to get it works correctly.

I know it’s a really stupid mistake but thanks for your help I could debug it and think differently so anyway thanks a lot guys. It’s good to have fast help in this forum I really appreciate