Introduction
The
Vector3 structure represents a 3D coordinate, and is one of the backbone structures of the
UnityEngine library. The
Vector3 structure is most commonly found in the
Transform component of most game objects, where it is used to hold
position and
scale.
Vector3 provides good functionality for performing common vector operations.
You can read more on the Vector3 structure in the Unity API.
Syntax
- public Vector3();
- public Vector3(float x, float y);
- public Vector3(float x, float y, float z);
- Vector3.Lerp(Vector3 startPosition, Vector3 targetPosition, float movementFraction);
- Vector3.LerpUnclamped(Vector3 startPosition, Vector3 targetPosition, float movementFraction);
- Vector3.MoveTowards(Vector3 startPosition, Vector3 targetPosition, float distance);