RotateVector
Jump to navigation
Jump to search
Note: This feature is for ZScript only. |
native clearscope static Vector2 RotateVector(Vector2 vec, double angle)
Usage
Rotates a 2D vector by the given angle. Used to get a vector to point in a new direction without modifying the magnitude of the vector.
This function can only be directly called by classes inheriting from Actor. In non-Actor classes, it can be called as Actor.RotateVector
.
Parameters
- vec - The 2D vector to rotate
- angle - How many degrees to rotate the vector by. Negative values rotate it clockwise while positive values rotate it counterclockwise.
Return value
Returns the rotated Vector2.
Examples
![]() |
Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated. |