• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Moving Unit to Nearest Region

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Yes. You can add all the possible teleport regions (assuming GUI rect) to an array. You can then linear search to find the one with the closest edge or origin to the position of entering unit in response to a unit enters region event.

Be aware the event works with regions (no GUI form) while GUI uses rect (GUI region).
 
Status
Not open for further replies.
Top