「Unity/3d/2点間角度」の版間の差分
提供: 初心者エンジニアの簡易メモ
行1: | 行1: | ||
<pre> | <pre> | ||
var quaternion = Quaternion.LookRotation(target.position - player.position); | var quaternion = Quaternion.LookRotation(target.position - player.position); | ||
+ | target.transform.localRotation = quaternion; | ||
</pre> | </pre> | ||
参考:https://www.create-forever.games/distance-rotation-quaternion/ | 参考:https://www.create-forever.games/distance-rotation-quaternion/ |
2022年9月12日 (月) 16:52時点における版
var quaternion = Quaternion.LookRotation(target.position - player.position); target.transform.localRotation = quaternion;
参考:https://www.create-forever.games/distance-rotation-quaternion/