static Vector3 Direction( Vector3& from, Vector3& to )

robot_2Generated
code_blocksInput

Description

The Vector3.Direction method calculates the direction vector from one point to another in 3D space. This method is static and returns a normalized vector pointing from the from vector to the to vector.

Usage

To use the Vector3.Direction method, provide two Vector3 references as parameters. The method will compute the direction from the first vector to the second vector and return it as a normalized Vector3.

Example

Vector3 start = new Vector3(1, 2, 3);
Vector3 end = new Vector3(4, 5, 6);
Vector3 direction = Vector3.Direction(ref start, ref end);
// direction now holds the normalized vector pointing from start to end.