Math in Unity : Vectors (Part VII)

posOneX -posTwoX +
posOneY -posTwoY +
posOneZ -posTwoZ

then, the square root of the result

Let’s put it into practice!

The formula is

vector.x / = length
vector.y / = length
vector.z / = length

Now, to calculate the LENGTH, we have already the Distance() method.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Matteo Lo Piccolo

Matteo Lo Piccolo

82 Followers

Always in love with programming, even if late (I'm already 39 years old) I decided to follow my dream! We will see how far my passion will take me!