Unity
我是新手,我正在制作第一人称游戏。我观看了此视频https://youtu.be/_QajrabyTJc,并尝试使用Unity
Remote 5且相机未旋转。代码在这里:
public float mouseSensitivity = 100f;
public Transform playerBody;
float xRotation = 0f;
void Update()
{
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
playerBody.Rotate(Vector3.up * mouseX);
}
我该如何解决这个问题?还是仅因为我在使用Unity Remote 5而未在Android mobile上使用?