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,
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)
}