Returns a 2D vector with the X component set to 1. This represents the left-hand direction in 2D space.
Returns a 2D vector with the X component set to 1. This represents the left-hand direction in 2D space.
The Vector2.Left
property is a static property of the Vector2
struct. It provides a convenient way to access a vector that points to the left in a 2D coordinate system. This can be useful in various mathematical operations, such as moving an object to the left or calculating directions.
// Example of using Vector2.Left Vector2 leftDirection = Vector2.Left; // Use the leftDirection vector to move an object to the left GameObject myObject = new GameObject(); myObject.Position += leftDirection * speed * Time.Delta;