Quaternion.LookRotation
Unity3D 2019. 4. 23. 10:55the direction can be described as the normalized difference between two points.
- Vector3 direction = (target.position - your.position).normalized;
- Quaternion look = Quaternion.LookRotation(direction);
- transform.rotation = look;
https://answers.unity.com/questions/1142832/character-facing-direction-of-movement-movement-us.html
'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 |