Hi all.
I made a small demo that show the order of the objects detected by Physics.OverlapSphere.
Hope it shows all aspects clear enough.
Hi all.
I made a small demo that show the order of the objects detected by Physics.OverlapSphere.
Hope it shows all aspects clear enough.
When running this simulation, order will change if I rotate the system around the origin. And sometimes the order will just change again after a few seconds even with not moving or rotating anything.
Yes… if the documentation does not say “will always be in this order,” (and it doesn’t say that), the order will NEVER be guaranteed, even if you happen to notice it is always in a particular order on your machine.
You run it on a different day, different machine, different reimport, different build target, different astrological zodiac sign and the order will be different.
In other words, if you rely on some particular unpromised order, your software is almost certain to fail, even if it hasn’t yet.