Vec2To

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


native clearscope vector2 Vec2To(Actor other) const

Usage

Gets a 2D vector that points in the direction from the caller to other. This should be used over doing it manually since it will take sector portals into account. This is calculated from the caller's xy origin (the middle of the Actor) to other's xy origin.

Parameters

  • other - The Actor to point the vector towards

Return value

Returns a Vector2 pointing towards other with a magnitude matching the 2D distance between the caller and other.

Examples

Nuvolachalk.png 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.