GetCharacterMovement

Hi Eceryone!
I’m trying to follow this tutorial, about an fps controller: A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

And when coding the movements

	if ((Controller != NULL) && (value != 0.0f))
	{
		// find out which way is forward
		FRotator Rotation = Controller->GetControlRotation();
		// Limit pitch when walking or falling
		if (CharacterMovement->IsMovingOnGround() || CharacterMovement->IsFalling())
		{
			Rotation.Pitch = 0.0f;
		}
		// add movement in that direction
		const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
		AddMovementInput(Direction, value);
	}

I’m having troubles with CharacterMovement (I have my own class AFPSCharacter : public ACharacter )
Who inherits from ACharacter, but the CharacterMovements seem to be Private, and if i use the getter GetCharacterMovementComponent, it returns a PawnCharacterMovement.

How could i fix this code? Any hints would be really appreciated!
Thanks in advance!

Hi CalaveraX,

The proper getter to get the Character Movement component of a Character is GetCharacterMovement(), not GetCharacterMovementComponent().

Hope it helps.

That gives me an error (My visual studio is in spanish, so i’m not sure about how to correctly translate it)

Error (activo) E0393 no se permite un puntero a un tipo de clase incompleta

Ohhh, i’m feeling like an idiot now… i just had to include
#include “GameFramework/CharacterMovementComponent.h”
Thanks!