ボイドLookAt2D(ターゲットを変換) { するVector3 DIR = target.position - transform.position。 フロート角= Mathf.Atan2(dir.y、サンプルプログラムdir.x)* Mathf.Rad2Deg。 transform.rotation = Quaternion.AngleAxis(角度、Vector3.forward)。 }
X方向の軸ポインティング
ボイドLookAt2D(ターゲットを変換) { するVector3 DIR = target.position - transform.position。 フロート角= Mathf.Atan2(dir.y、サンプルプログラムdir.x)* Mathf.Rad2Deg。 transform.rotation = Quaternion.AngleAxis(角度、Vector3.forward)。 }
X方向の軸ポインティング