bUseControllerRotationPitch = false;
bUseControllerRotationYaw = false;
bUseControllerRotationRoll = false;
//will let the character face the direction of acceleration/movement
GetCharacterMovement()->bOrientRotationToMovement = true;
当我编译它并在ue4中运行程序时,它不知何故不会将我的角色旋转到加速的方向,有人知道为什么吗?勾选了角色的移动和方向旋转到移动,但似乎真的找不到使用控制器旋转偏航,我应该手动取消选中其中一个吗?
对于仍然想知道我的情况的人来说,问题是UCharacterMovementComponent::RotationRate
仅初始化为零。
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = true;
bUseControllerRotationRoll = false;
//will let the character face the direction of acceleration/movement
GetCharacterMovement()->bOrientRotationToMovement = true;
请尝试以上代码一次。我认为轮换问题会解决的。