Advertisemen
Script used in this video :
using UnityEngine;
using System.Collections;
public class rotObj : MonoBehaviour
{
float rotSpeed = 20;
void OnMouseDrag()
{
float rotX = Input.GetAxis("Mouse X")*rotSpeed*Mathf.Deg2Rad;
float rotY = Input.GetAxis("Mouse Y")*rotSpeed*Mathf.Deg2Rad;
transform.RotateAround(Vector3.up, -rotX);
transform.RotateAround(Vector3.right, rotY);
}
}
using System.Collections;
public class rotObj : MonoBehaviour
{
float rotSpeed = 20;
void OnMouseDrag()
{
float rotX = Input.GetAxis("Mouse X")*rotSpeed*Mathf.Deg2Rad;
float rotY = Input.GetAxis("Mouse Y")*rotSpeed*Mathf.Deg2Rad;
transform.RotateAround(Vector3.up, -rotX);
transform.RotateAround(Vector3.right, rotY);
}
}
Advertisemen
Tidak ada komentar:
Posting Komentar