即使我在虚幻引擎4中打开了"定向旋转到移动",角色也没有按照加速度的方向旋转


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;

请尝试以上代码一次。我认为轮换问题会解决的。

最新更新