5월, 2016의 게시물 표시

유니티 에티터 곡선 연결 노드 만들기

http://gamedevst.tistory.com/category/Unity5

타겟방향을 따라 회전 하기

using  UnityEngine; using  System.Collections; public   class   test_rotation  :  MonoBehaviour  {      public   Transform  target;      Vector3  lookDir;      void  Start () { } void  Update () {                   // 방향은 노멀라이즈 사용         lookDir = (target.position - transform.position).normalized;          Quaternion  from = transform.rotation;          Quaternion  to =  Quaternion .LookRotation(lookDir);         transform.rotation =  Quaternion .Lerp(from, to,  Time .fixedDeltaTime); } }