RotateGameObject.cs 380 Bytes
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using System.Collections;

public class RotateGameObject : MonoBehaviour {

	public float RotationVariable = 4.0f;
	public float RotateLeftRight = 0.0f;

	void OnMouseDrag( )
	{
		transform.Rotate(0.0f, -RotateLeftRight, 0.0f);
		RotateLeftRight = Input.GetAxis ("Mouse X") * RotationVariable;
	}

}