How to change Max Walk Speed in C++?

GetMovementComponent() returns a UPawnMovementComponent, not a UCharacterMovementComponent. To get the character one, you can either cast to it or just call GetCharacterMovement().

And don’t forget to include the header:
#include "GameFramework/CharacterMovementComponent.h"

3 Likes