【发布时间】:2018-08-13 08:47:23
【问题描述】:
我希望我的相机跟随玩家旋转,但相机应该始终与玩家保持一定角度。 我有这个:
transform.rotation = player.transform.rotation;
但现在相机直视玩家,而不是从上方倾斜。如何将我想要的角度添加到旋转中? 感谢您的帮助!
【问题讨论】:
标签: unity3d rotation position transform quaternions
我希望我的相机跟随玩家旋转,但相机应该始终与玩家保持一定角度。 我有这个:
transform.rotation = player.transform.rotation;
但现在相机直视玩家,而不是从上方倾斜。如何将我想要的角度添加到旋转中? 感谢您的帮助!
【问题讨论】:
标签: unity3d rotation position transform quaternions
transform.rotation = player.transform.rotation + wantedAngle;
【讨论】:
Quaternions 必须使用乘法 * 而不是加法 + 进行组合!
我不得不使用
transform.rotation = player.transform.rotation * Quaternion.Euler(45,0,0);
【讨论】: