Quaternion.LookRotation

Unity3D 2019. 4. 23. 10:55
반응형

the direction can be described as the normalized difference between two points.

  1. Vector3 direction = (target.position - your.position).normalized;
  2. Quaternion look = Quaternion.LookRotation(direction);
  3. transform.rotation = look;
  4.  

https://answers.unity.com/questions/1142832/character-facing-direction-of-movement-movement-us.html

 

Character facing direction of movement - movement using camera transform? - Unity Answers

 

answers.unity.com

 

반응형

'Unity3D' 카테고리의 다른 글

LayerMask  (0) 2019.05.01
world, screen, viewport  (0) 2019.04.23
(unity) find child recursively  (1) 2019.04.21
Orthographic size  (0) 2019.04.17
How Unity Supports Cross Platform Feature  (0) 2019.03.20
: