Hi guys, so I want to write a function which should let neutral units detect a nearby item and pick it up.
Since the units are moving and the items aren't always at the same location, I was trying to index the location of every item as well as of every unit and compare if these two locations are within a certain range to each other. Since there are many units and items on the map and I was running the check every second, it did lead to heavy lagging.
Do you know of a more effective way of conducting this check? Maybe there is a native I do not know of which I can use?
Thanks!
Since the units are moving and the items aren't always at the same location, I was trying to index the location of every item as well as of every unit and compare if these two locations are within a certain range to each other. Since there are many units and items on the map and I was running the check every second, it did lead to heavy lagging.
Do you know of a more effective way of conducting this check? Maybe there is a native I do not know of which I can use?
Thanks!