Set a constant speed when button is held?

I want to recreate the boost function used in modern Sonic games (Unleashed, Colors, Generations, and Forces.)
However, I’m only able to increase my maximum speed when holding a button, rather than that button press moving me at high speed by itself. I’ve tried adding movement input, but increasing the scale value doesn’t put me at a high speed, it doesn’t do much at all except move me an inch. Any way I can get this working?

Play with Accelaration inside your Movement Component. Should do the trick.

Not really sure what to do with any of it. I can get/set max acceleration, and get current accel, but I can’t set it. I want the button to boost me forward and keep me running at a certain speed even without an input on the axis, but this just increases how fast I can go and how fast I can reach that speed if I have do input on the stick.

I’m not familiar with those games in particular but it seems like you want to press a button and have the player move forward at a higher speed for a given amount of time yes? I just tried using a timeline to push a value to add movement input node like there is on the thirdpersonBP and it seemed to work. I set the timeline to a value of 1 and a duration of 3 seconds.

Doesn’t seem to be working the way I want it. It’s slowly accelerating me up to the max speed, rather than putting me full blast into it right away.

Try to unplug the timeline in the above example, and instead just plug in max speed variable into movement input, is it what you want to achieve?
If you want a smooth transition, you can use timeline, just make it short, a fraction of a second.

i didn’t use a curve in the timeline. I had two keyframes set to a value of 1 so it would immediately put you at full speed. The reason i used a timeline instead of just a straight value was to have the value applied over a time-span. you could use the update pin from the timeline node and a variable to achieve the same thing, i just used the value in a timeline track to make it simpler.

Edit: I just noticed there is a bit of ramp up with the example i gave but i believe its due to the max acceleration.

I think the best way to achieve this is to set yourself the velocity you want your player to achieve.
To do so, you can :

  1. get your velocity from your Character Movement Componenent / or the direction of the player input, depending on your gameplay.
  2. Normalize it so you keep the direction but the length is 1.
  3. Multiply it by the speed you want to achieve, still keeping the direction but setting the speed of your boost. The speed is in cm/s.
  4. setting the velocity on your character component.

Keep in mind that if the length of your velocity exceed your Max Walk Speed it will be clamped, so you may need to increase your max velocity for the duration of the boost.
Tell me if this is working for you. :slight_smile:

Sorry I took WAY too long to respond, I never had the chance. All that does is bump me forward a tiny bit on the ground, and send me soaring aimlessly.

Here’s an example of what it is I’m trying to achieve, for reference.

Hi Niko. Can you take a video or a gif of what you have ? It will be much simpler to see the issue.