Jack McLantern Hit Direction Establishment using Vector3.Dot in Unity 3D

Опубликовано: 19 Октябрь 2024
на канале: koyima
104
0

Using Vector3.Dot can be used to figure out if a Vector is closer to perpendicular or parallel to another vector

The dot product is a float value equal to the magnitudes of the two vectors multiplied together and then multiplied by the cosine of the angle between them.

For normalized vectors Dot returns 1 if they point in exactly the same direction, -1 if they point in completely opposite directions and zero if the vectors are perpendicular.

Follow the game here:

gamejolt: https://gamejolt.com#/games/jack-mclantern/360808
itch.io: https://swearsoft.itch.io/jackmclantern
Find more at: https://koyima.com