Sliding after running

Hey all! I’ve been doing some work in a bit of a video game doodle.

I’ve got my character sprinting, crouching, jumping, however I can’t seem to make it when you go from a jog or sprint to a crouch, you slide to the lower max speed.

I’ve tried to use fInterp to, fInterp ease in out, tried lerp, it didn’t work,

http://puu.sh/guJea/c33f7d7f9f.jpg

The intent is to add a long jump if you jump while sliding.

Thanks in advance!

Your [velocity alpha] multiply by zero.
If you want to slow down speed when crouch , it simplest way is set maxspeed by
Then you must use a variable like “brake” with value less than one then multiply with the current velocity to prevent long jump
I use Pseudocode for

Blockquote

Example :
// define brake variable 0-1

  • List item

[range 0 1] Float brake = 0.9;
If ( key down to Crouch) then SetMaxSpeed to new value ;
Else SetMaxSpeed to normal value ;
While (tick) do
{
If ( checkInAir () ) then Velocity *= brake (is the air factor to redure speed)
}

Blockquote