RotateGameObject.cs
382 Bytes
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using System.Collections;
public class RotateGameObject : MonoBehaviour {
private float RotationVariable = 4.0f;
private float RotateLeftRight = 0.0f;
void OnMouseDrag( )
{
transform.Rotate(0.0f, -RotateLeftRight, 0.0f);
RotateLeftRight = Input.GetAxis ("Mouse X") * RotationVariable;
}
}