Changing MaxWalkSpeed, Deceleration problem

Hello guys,

I’m in this situation. I have a character derived from ACharacter. This character has 3 states:
Idle, Walking, Running. I have implemented a simple state machine that changes the MaxWalkSpeed depending on the state the character is in. Everything works as expected, but there is a slight problem. When the character transitions from Idle to Walking or Running, it accelerates slowly as expected and the animations blend as expected. In other words I get good blending when accelerating to a higher speed. The problems is the other way around. If I decelerate I get no blending. For example, the character is in Running State, I press the toggle Walk/Run button, the character enters Walking State so my MaxWalkSpeed goes from 550 to 220, but the deceleration happens instantly so my animations don’t blend nice. I tried playing with the settings of the CharacterMovementComponent, but I can’t seem to make it work. The wanted effect is the deceleration to be the same as the acceleration, so the animations blend nice. I can always write my own version of acceleration/deceleration logic, but I want to use the CharacterMovementComponent, because I believed it should cover this scenario. I’m writting this question for tips. I have atteched my CharacterMovementComponent settings as an image.

Best regards.

In my Project, i use the MaxiWalkSpeed value to adjust movement speed, and i get a nice blending from MaxiWalkSpeed=200 to MaxiWalkSpeed=0
I only modified the
“Ground Friction” Walking
“braking deceleration Walking”
and other unrealated stuff

Your “braking deceleration Walking” seems to be very high, maybe adjust that. In case you have not tried it.

EDIT: My settings:

133921-wut.png

Thanks. I played a lot with these settings and I seem to be getting better results. Turns out my blend spaces could use tweaking too. I just have to find the best combination of friction, acceleration, deceleration for my animations. That process sure is annoying as hell :D. Your answer was helpful. I was wondering if my workflow was right.

Hey Tankbuster, I found the perfect solution. There is an option in the CharacterMovementComponent called “Use Separate Braking friction”. That way you can have high friction for the character overall (It doesn’t drift when making turns) and at the same time have a low friction when stopping. That gives an awesome smooth blending. You probably know about this :slight_smile:

Oh, since im very new to unreal i didn’t know about this. Thanks, it works well, and i can use it, too. =)

braking friction is greyed out for me, which I assume IS the seperate braking function… and so when I implement the node “seperate braking” inside the blueprint graph it still doesnt change anything.

Braking deceleration only applies if you are no longer applying any acceleration. If you are decreasing your speed from say 600 to 400 while still “applying acceleration” by pushing forward, say in the case of toggle based movement (toggling from walk/jog/run)this will not work.