Gradually speed up player while holding down a button

i’m trying to have my player speed up gradually while holding a button (think Super Mario 3)

i set up some toggles, but it’s more of an instant sprint instead of building up speed.

let me know if anyone has any suggestions. thanks!

https://flowlab.io/game/view/1451941

If you are trying to build up the speed try using the ease block. By using the toggle, it’s going to be an instant switch.

@0294910 ok awesome. do you think just swapping the toggle for the ease block would work? or would i need to rearrange some hook ups?

https://flowlab.io/game/view/1451941

Swapping the toggle and ease blocks definitely won’t work. What I would think you have to do is have two seperate ease blocks (one for each direction) and your speed-up button activating the inputs for the ease blocks.

The “From” input would be your initial, regular speed.
The “To” input would be your maximum, possible speed you can achieve with the speed-up.

Then in the ease block, you can change how long this “ease” takes and what type of ease you want (Quadratic should be fine).

After that connect the ease to the velocity block and babaam!

This is just a rough idea, you probably have to fix some stuff though.

There is a way easier way!
This is what the motor block is for. Set the speed to your max speed. If it goes too fast, try either lowering the max speed or adding density.

thanks @meburningslime !

i’m having trouble with connections. would you be able to a look real quick and suggest the best course of action?

thanks again!

https://flowlab.io/game/view/1451941

Replace the velocity block with a motor. The motor is being overidden by the velocity.