RTS/Third person shooter influenced by the game 'Hidden & Dangerous'

So one quite strange thing about the character movement component, is that there is currently no built in functionality for prone movement. Which is kind of annoying. Instead of going through the trouble of trying to hack it in the character, I’ve decided to extend the character movement component to cater for prone movement.

The Prone() and UnProne() functions work just like Crouch()/UnCrouch().

The StartTransition() and EndTransition() functions are actually used by the animation notify events. It will set IsTransitioning to true or false, which ultimately stops the player from moving. So for example, when the stand to prone animation is playing, we don’t want them to be able to move until that animation has finished. There’s a notify event at the beginning and end of the animation.

As you can also see, I’ve set it up so the prone movement speed can be edited in the unreal editor, just like the way you can edit walk and crouch speed.


UCLASS()class HDREMAKE_V4_API UExtendedCharacterMovement : public UCharacterMovementComponent
{
    GENERATED_BODY()
private:


    bool IsTransitioning = false;
    bool IsProne = false;
    virtual float GetMaxSpeed() const override;


public:


    UPROPERTY(Category = "Character Movement: Walking", EditAnywhere, BlueprintReadWrite, meta = (ClampMin = "0", UIMin = "0"))
    float MaxProneSpeed;
    
    UFUNCTION(BlueprintCallable, category = "Custom movement")
    void Prone();


    UFUNCTION(BlueprintCallable, category = "Custom movement")
    void UnProne();


    UFUNCTION(BlueprintCallable, category = "Custom movement")
    void StartTransition();


    UFUNCTION(BlueprintCallable, category = "Custom movement")
    void EndTransition();
};