Smooth Transition Issue - Not Lerping Except First Time in Array

Greetings. I am working on a smooth character transition blueprint so when the player presses the left or right arrow key, an index changes and is then supposed to lerp the player’s position to the next/previous point (depending on left or right arrow key). Currently, it only lerps when i press start, but after changing the index, it instantly teleports the player.

I have a couple issues:

  1. I want it to Lerp the position and rotation but it is just teleporting after the first time
  2. The rotation is not changing at all
  3. How can i change the speed of the lerp? Like i said, it works right when i run it, but it is still very quick.

I am using the first person template. I dont fully understand timeline nodes but am using one. The index increase is working properly, just not changing positions/rotation. Any and all help is appreciated.

Note, I have tried using Set Actor Location, Set Actor Transform, and Set Actor Location and Rotation. Regardless of Transform or Loc & Rot node, the rotation does not change while the position does. Thanks

Hey @Cscox! Welcome to the forums! :slight_smile:

So for your questions in order:

The reason it’s doing a teleport after the first one is because you’re using “Play”, once it hits the end of the timeline, every time it plays it uses the current point in the timeline- use “Play from Start” to start it from the beginning each time.

Secondly, to slow down the Lerp, open the timeline (double click) and increase the time between the first and last key. :slight_smile: As the timeline plays it adjusts the value of your float over time- extend the time and you slow the change.

As an additional note, you probably don’t want to run this on tick, because then it is firing ALL THE TIME and if you use “Play from Start” it will always refresh each tick. You will likely want to make a custom event (NOT a function- timelines don’t work in functions) and then call this event any time an index changes in that other part of the code! :slight_smile:

Thank you for the assistance! Your first 2 answers worked great. I understand the 3rd answer and will work on it soon. But do you know why the character doesn’t rotate? Its basically identical logic as the location logic but it doesn’t rotate at all. Any help is appreciated again!

Hmmm… Try separating it out into “Set Location” and THEN “Set Rotation” all on the update. Sometimes breaking things out into separate functions works better- can’t explain why, but trying weird stuff like that is how I learned. :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.