RotateWithMouase

 avatar
unknown
csharp
a year ago
342 B
4
Indexable
using UnityEngine;

public class RotateWithMouse : MonoBehaviour
{

    public float Speed = 1; 
  
    void Update()
    {
        if(Input.GetMouseButton(0))
        {
            transform.eulerAngles += Speed * new Vector3( x: -Input.GetAxis("Mouse Y"), y: Input.GetAxis("Mouse X"), z: 0);

           
        }
    }
}
Editor is loading...