How can I use a Variable as Value inside of a timeline?

Hi, as you can see in the headline I am trying to set my Walkepeed with a timeline to slowly spow down.
But I am using a Sprint funktion as well, so how can i use a variable in the timeline to slow down from the speed the pawn has at the time?
Thanks. I apologize for my englisch.

how can i use a variable in the
timeline to slow down from the speed
the pawn has at the time

You cannot (well, you can, but it’s fiddly and awkward), and that’s not what Timelines are used for. Their tracks are better used as alpha to interpolate between 2 set values.

In order to smoothly change player walking speed, it’s much better to fInterpTo between 2 target values during tick - this will give you a smooth transition that can be interrupted (or reversed) much more elegantly than a timeline.

Ok, thanks. Helped me a lot.

Well, could you pls tell me, how the awkward way works?
I tried it with the Finterp to, but i dont know how to break it, i used a while loop, but it said infinte loop.

While loop? Definitely not the right way to go. And do not pursue the timeline way, it’s not worth your time in this case - timelines have a specific use where you need to interpolate in precisely X amount of time. In your case, as you observed yourself, the current player speed is quite a fluid value.

The most basic sprint system would look like this:

For as long as you hold shift the player speed is 1200, if not shift is pressed it goes back the 600. The fInterpTo will smoothly change it between the 2 values based on its Interp Speed (the higher, the faster the transition).

Not entirely sure what you’re after but if you need 5 different players speeds, I would build an enumerator and plug it into the Select node above. This will give you access to different movement speeds that can be easily modified by something that lives outside the player BP (entering shallow / deep water, stepping on a speed tile and so on). And it does not need to revolve around a player holding a key, of course.

If what I posted is not enough and you can’t get it to work the way you imagined, consider dropping a bit more of descriptive info regarding how you envisioned it! I’ll try to chip in what I can.

And good luck!

edit: typos

So for example:

And any other blueprint can do something along the lines:

Untested but should work. Hope it helps.

Thanks, but actually i am trying to create some kind of slide like in titanfall 2.
I had a second question for that and i solved it based on that, but at the time it doesnt matter, if i am running or walking so i want it to slow down based on the velocity the pawn has at the time.

Not particularly familiar with Titanfall 2 mechanics (apart from wall running) but it sounds like the method I suggested is perfect for this.

if i am running or walking so i want
it to slow down based on the velocity
the pawn has at the time.

Not following this bit at all. You want to slow down based on the current player speed? Surely, you want an external factor to modify your speed, right? I am confused, are you talking about time dilation or player movement speed - these are 2 completely different things!

Player Movement Speed
First i am checking if the velocity is my crouch speed
Then i do have a timeline, wich goes from 1400(200 more than runspeed) to 300(crouch speed) and i am setting the MaxWalkSpeed to that value and then add a forward movement input as long as i hold Left Ctrl.
Everything works fine, but it does it with 1400 when i am running, walking or wall running(yes, i do have that, but inspired by a video).

Sorry, I don’t understand what you mean. I don’t even know at this point whether is works for you or still does not. Using a timeline for changing player speed is not a good idea, timelines are not dynamic enough. You have a working solution up there, take it or leave it. It will interpolate from any speed to any speed, any time, and smoothly, to boot.

Good luck.