I don’t always have access to my VR headset and I’d like to be able to move around the world using mouse and keyboard. I added Some controls to move the camera via mouse but am having an issue.
AddControllerYawInput
behaves correctly and turns my camera left and right, but AddControllerPitchInput
does not seem to work. I posted the entire function below.
// Called to bind functionality to input
void AVRCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("Forward", this, &AVRCharacter::MoveForward);
PlayerInputComponent->BindAxis("Right", this, &AVRCharacter::MoveRight);
// AddControllerYawInput works and turns the camera
PlayerInputComponent->BindAxis("Turn", this, &AVRCharacter::AddControllerYawInput);
// AddControllerPitchInput does not work
PlayerInputComponent->BindAxis("LookUp", this, &AVRCharacter::AddControllerPitchInput);
}