I have went through the Project Settings and set Axis Mappings to Yaw(Mouse X Scale 1.0) and Pitch(Mouse Y Scale 1.0)
When I go to code it in my Avatar.h I have
UCLASS()
class EOF_EARLY_API AAvatar : public ACharacter
{
GENERATED_BODY()
void SetupPlayerInputComponent(class UInputComponent * InputComponent) override;
void Yaw(float amount);
void Pitch(float amount);
};
//And in my Avatar.cpp I have
void AAvatar::SetupPlayerInputComponent(class UInputComponent * InputComponent)
{
check(InputComponent);
InputComponent -> BindAxis("Yaw", this, &AAvatar::Yaw);
InputComponent -> BindAxis("Pitch", this, &AAvatar::Pitch);
}
void AAvatar::Yaw(float amount)
{
AddControllerYawInput(200.0f * amount * GetWorld()->GetDeltaSeconds());
}
void AAvatar::Pitch(float amount)
{
AddControllerPitchInput(200.0f * amount * GetWorld()->GetDeltaSeconds());
}
But for some reason when I go to test play, my mouse Y does not work, the Yaw(X Axis) works just fine.