Files
game-demo/Assets/scripts/CameraControllerX.cs

18 lines
356 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraControllerX : MonoBehaviour
{
[SerializeField]
private float mouseSpeed = 20f;
void Update()
{
float mouseX = Input.GetAxis("Mouse X");
transform.Rotate(Vector3.up * (mouseX * mouseSpeed));
}
}