How to acces CharacterMovementComponent on AMainCharacter

My goal is to make a run function but i just cannot seem to acces the “MaxWalkSpeed” variable in order to modify it.
I have tried to get acces through the GetComponent Function but it does nothing.

Run function:

full CPP page:

I am a bit late, but in case you haven’t figured it out yet. Here is how I did it.
You have to declare a UCharacterMovementComponent* in your header file.
Let’s say you name it CharacterMovementRef.
So that would look something like this UCharacterMovementComponent* CharacterMovementRef;
Than in the cpp file you go to the constructor and initialize it.
CharacterMovementRef = GetCharacterMovement();
You will than be able to access CharacterMovement by CharacterMovementRef->

They are missing the CharacterMovementComponent include, hence why intellisense is complaining.