Programming/Unity
[Unity] 회전하는 오브젝트 스크립트
생각하는로뎅
2017. 10. 9. 15:25
반응형
1. 회전하는 오브젝트 스크립트
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rotation : MonoBehaviour {
// Update is called once per frame
void Update () {
// Time.deltaTime은
// '지난 프레임이 완료되는데 까지 걸린 시간을 나타내며, 단위는 초를 사용' 한다.
// 아래 수식은 초당 15, 30, 45를 이동하라는 의미이다.
transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime);
}
}
반응형