Download

Is there a way to make AddMovementInput travel a set distance?

This might be a silly question, but I’m trying to figure out a way to make the player smoothly move some arbitrary distance (100cm in my case) in a given direction, as the mechanical counterpart to my dodgeroll animation. I could use FMath::VInterpTo, but if the player moves off an edge it can result in weird behavior, like floating over the gap while interpolating. AddMovementInput every tick looks much smoother, and it correctly causes the player to interact with physics correctly, but it forces the roll’s performance (speed, reaction to mass & friction) to be identical to walking/running’s performance.

So is there an obviously better way to smoothly travel over a set distance? It feels like I’m making this too complicated in my head, but besides movement impulses or interpolation, I’m not sure what else I should be looking into.

I put my dodge roll’s AddMovementInput into an event tick so every tick it adds the movement if my dodge variable is set to true. I don’t know if this is the “proper” way to do it but it works for me

How do you deal with dodging and walking having different speeds? For me, you don’t actually walk around that quickly, so my maximum walk speed is set quite low, around 350. For stuff like rolls and dodges you want the motion to be very heavy and zippy, closer to the 750-1000 range, but when I apply it through AddMovementInput it hits that cap and tops out at my walk speed.