C++ MaxWalkSpeedCrouched Setting

Hello,

I’m here running my head in circles (maybe it’s to do with how i’m stating the code but at the moment looks more like an oddity).

The Code is as Follows:

if (ProneStatus == EPlayerActivityStatus::Available) //To Prone!
        {
            Character->GetCharacterMovement()->StopMovementImmediately();
            if (!Character->GetCharacterMovement()->IsCrouching())
            {
                Character->Crouch();
            }
            Character->GetCharacterMovement()->MaxWalkSpeedCrouched = MaxCrouchedSpeeds.Y;
            Changed = true;
            NewProneStat = EPlayerActivityStatus::InUse;
        }
 else if (ProneStatus == EPlayerActivityStatus::InUse) // Out of Prone!
        {
            Character->GetCharacterMovement()->StopMovementImmediately();
            Character->GetCharacterMovement()->MaxWalkSpeedCrouched = MaxCrouchedSpeeds.X;
            Changed = true;
            NewProneStat = EPlayerActivityStatus::Available;

If either these are true, then the Max Speed is to be changed to My FVector2D Structure
Where FVector2D(Normal Crouched, Prone Crouched).

Here’s the odd behavior (Where MaxCrouchedSpeeds.X = 250, and .Y = 125):

If I am going to Prone, MaxCrouchedSpeed changes to 125.
if I am going out of Prone, MaxCrouchedSpeed changes to 250 but can only move at 173 (75%) by single input. ← This meaning that I can only achieve 250 if I’m adding input from Different Direction Vectors. So from WASD Movement, If only one Key at a time, Max speed is 173. It only Reaches 250 if WA, WS, DS, DA inputs are fed. If I activate Prone again, Speed is correctly changed to 125 properly once more (and stays at that regardless of WASD combinations).

Why is this happening?

If this is expected behavior, what should I do differently to get the desired functionality?

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks