How to get the MIDDLE POINT between two objects in Unity

Опубликовано: 12 Октябрь 2024
на канале: GDT Solutions
750
18

In this video we see how to determine the midpoint between two objects in Unity, for that we use the Lerp function from the Vector3 class.

The Lerp function requires 3 parameters, two of them are a Vector3 for the first and second position, the third parameter is a float to use as an interpolation value, 0 basically means the first vector, 1 means the second vector and all the values in the middle represent all the position in between the two vectors.

To get the middle point between two objects we use 0.5f as an interpolation value.
____________________________________________________________
PORTFOLIO: https://gamedevtraum.com/en/portfolio...
CONTACT:   / gamedevtraum  
LINKEDIN:   / gamedevtraum  
____________________________________________________________