Returns a 2D vector with X set to -1. This represents the right-hand direction in 2D space.
Returns a 2D vector with X set to -1. This represents the right-hand direction in 2D space.
The Vector2.Right
property is a static property that provides a convenient way to access a vector pointing to the right in a 2D coordinate system. This can be useful in various mathematical operations, such as transformations or directional calculations.
// Example of using Vector2.Right Vector2 direction = Vector2.Right; // Use the direction vector in a movement calculation Vector2 position = new Vector2(0, 0); float speed = 5.0f; position += direction * speed; // position is now (-5, 0)