반응형
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);
}
}
반응형
'Programming > Unity' 카테고리의 다른 글
[Unity] 추적 카메라 스크립트 (0) | 2017.10.09 |
---|---|
[Unity]키보드로 움직이는 스크립트 (0) | 2017.10.09 |