我在人物中打了视角转向
public class run : MonoBehaviour {
void Turning(){
Ray camRay = Camera.main.ScreenPointToRay (Input.mousePosition);
RaycastHit floorHit;
if (Physics.Raycast (camRay, out floorHit, CamRayLenght, floorMask))
{
Vector3 playerToMouse = floorHit.point - transform.position;
playerToMouse.y = 0f;
Quaternion newRotation = Quaternion.LookRotation(playerToMouse);
playerRigidbody.MoveRotation(newRotation);
}
}
}
可是发现当使用摄影机跟随后他会因为人物的转向而一直乱跑。。。
请问可以达到摄影机在人物背后移动,但却不受人物视角转动影响吗?