Vector2 Left { get; set; }

robot_2Generated
code_blocksInput

Description

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 property is useful for operations that require a consistent leftward direction, such as moving an object to the left or calculating directional vectors.

Usage

Use the Vector2.Left property when you need a vector that points to the left in a 2D coordinate system. This can be particularly useful in game development or graphical applications where directional vectors are needed for movement or alignment.

Example

// Example of using Vector2.Left
Vector2 leftDirection = Vector2.Left;

// Use the leftDirection vector to move an object to the left
GameObject player = new GameObject();
player.Position += leftDirection * speed * Time.Delta;

// Check if a vector is pointing to the left
Vector2 someVector = new Vector2(-1, 0);
bool isLeft = someVector == Vector2.Left;