Vec2To

native clearscope vector2 Vec2To(Actor other) const

Note: This feature is for ZScript only.

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

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.
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.