The Vector2.Left
property provides a static 2D vector with the X component set to -1, representing the left-hand direction in 2D space. This is useful for operations that require a directional vector pointing to the left.
The Vector2.Left
property provides a static 2D vector with the X component set to -1, representing the left-hand direction in 2D space. This is useful for operations that require a directional vector pointing to the left.
Use Vector2.Left
when you need a constant vector pointing to the left in 2D space. This can be particularly useful in graphical applications or games where directional vectors are needed for movement or alignment.
// Example of using Vector2.Left Vector2 leftDirection = Vector2.Left; // Use the leftDirection vector in a movement function void MoveLeft(GameObject obj, float speed) { obj.Position += leftDirection * speed * Time.Delta; }