RotateWithMouase
unknown
csharp
2 years ago
342 B
5
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...