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!
So I'm making this unit move using SetUnitX/Y but whenever the unit goes out of the map boundaries(the black area) then the game suddenly crashes, so how can I *detect* if the unit is going out of map boundaries and teleport the unit away from it ?
You can check if if x/y is still in map.
In JASS for example you save max/min values of x/y of map bounds,
and then make comparisons if your x/y are in between.
Be aware that flying units directly at the border of the map have been known to crash even though they are still in map bounds. As such you really need a few tiles boundary around your map on top of the x/y inside map bounds.
In JASS for example you save max/min values of x/y of map bounds,
and then make comparisons if your x/y are in between.
It'll ensure that units will stay within the map boundaries. It is much more convenient than having to check map bounds every time you use SetUnitX/SetUnitY.
Sorry for the late reply xD,
I think I'll try to do it with GUI first, but if I can't then I'll try and use that vJass code PurgeandFire posted Thx guys
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.