正在制作第三人称摄像机跟随,做完之后在运行的时候鼠标消失了
{
public float mouseSensitivity; // 鼠标灵敏度
public Transform top;
public void Start()
{
top = transform.parent;
Cursor.lockState = CursorLockMode.Locked; //鼠标固定在中间
}
public void Update()
{
Rotate();
}
public void Rotate()
{
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime; //鼠标移动值
top.Rotate(Vector3.up,mouseX);
}
}