首页 > 解决方案 > AddControllerPitchInput 使网格旋转

问题描述

我希望我的相机像第三人称相机一样围绕我的角色移动,我用“AddControllerPitchInput”添加了“BindAxis”,但它会随着我的角色旋转(就像如果我往下看它看起来我的角色躺在地板上,它会随着我移动旋转)。我有一个 c++ 类字符和 BP 字符,BP 字符有弹簧臂和相机,相机是弹簧臂的子项。在我的项目设置中,我有

LookAside
   Mouse X 1,0
LookUp
   Mouse Y -1,0

'我在 MyCharacter.cpp 中有代码

void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent){
       Super::SetupPlayerInputComponent(PlayerInputComponent);;
       PlayerInputComponent->BindAxis(TEXT("LookAside"), this, &APawn::AddControllerYawInput);
       PlayerInputComponent->BindAxis(TEXT("LookUp"), this, &APawn::AddControllerPitchInput);}

我在 Sprind 手臂上打开了“使用 Pawn Control Rotation”并在相机上关闭了。也许我偶尔会打开别的东西?提前致谢

标签: unreal-engine4unreal-blueprint

解决方案


推荐阅读