Untitled

mail@pastecode.io avatar
unknown
csharp
a month ago
342 B
0
Indexable
Never
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);

           
        }
    }
}