単位ベクトルの取得方法を自分用にメモ。
[ 取得方法 ]
「Vecotr3.normalized」で取得できます。
[ 使用例 ]
下記はVector3Testの単位ベクトルをコンソールに出力します。
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ScriptTest : MonoBehaviour { void Start() { Vector3 Vector3Test = new Vector3(20, 50, 70); Debug.Log(Vector3Test.normalized); } }