Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class _objRot : MonoBehaviour
- {
- float rotSpeed = 125;
- // Use this for initialization
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
- void OnMouseDrag()
- {
- float rotX = Input.GetAxis("Mouse X") * rotSpeed * Mathf.Deg2Rad;
- float rotY = Input.GetAxis("Mouse Y") * rotSpeed * Mathf.Deg2Rad;
- transform.Rotate(Vector3.up, -rotX, Space.World);
- transform.Rotate(Vector3.right, rotY, Space.World);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement