Unity3d Unity摄像机跟随玩家旋转

Unity3d Unity摄像机跟随玩家旋转,unity3d,rotation,position,transform,quaternions,Unity3d,Rotation,Position,Transform,Quaternions,我希望我的相机跟随播放器旋转,但相机应该始终与播放器成一定角度。 我有这个: transform.rotation = player.transform.rotation; 但现在,摄像机直视玩家,而不是从上方的角度。如何将想要的角度添加到旋转中? 谢谢你的帮助 我不得不使用 transform.rotation = player.transform.rotation + wantedAngle; transform.rotation = player.transform.rotation

我希望我的相机跟随播放器旋转,但相机应该始终与播放器成一定角度。 我有这个:

transform.rotation = player.transform.rotation;
但现在,摄像机直视玩家,而不是从上方的角度。如何将想要的角度添加到旋转中? 谢谢你的帮助

我不得不使用

transform.rotation = player.transform.rotation + wantedAngle;
 transform.rotation = player.transform.rotation * Quaternion.Euler(45,0,0);

我想要的角度会随着时间的推移而改变,因为当我旋转播放器时,相机角度会改变,所以这不起作用。也许你错了?也许你真的不想让你的相机跟随播放器的旋转?Try:transform.rotation=wantedAngle<代码>四元数必须使用乘法而不是加法来组合!