【发布时间】:2018-09-19 14:27:08
【问题描述】:
我正在使用一个简单的脚本让相机跟随玩家目标。
// Use this for initialization
void Start()
{
//Calculate and store the offset value by getting the distance between the player's position and camera's position.
offset = transform.position - player.transform.position;
}
// LateUpdate is called after Update each frame
void LateUpdate()
{
// Set the position of the camera's transform to be the same as the player's, but offset by the calculated offset distance.
transform.position = player.transform.position + offset;
}
但是当我开始游戏时,玩家开始旋转并在第一次碰到对撞机时忽略对撞机。
在我将此脚本放在播放器上后,这开始发生。我什至尝试冻结旋转,但如果我冻结旋转,我无法用动画旋转我的播放器。我该如何解决这个问题?
【问题讨论】: