Segger Posted June 13, 2015 Share Posted June 13, 2015 Help! Currently I'm trying to use a large invisible sprite object that is set to the same position of my space ship to check for collisions of nearby objects as a sort of scanner, rather than iterating through all my objects and checking their distance. I would like to be able to run some code the first time the sprite collides and when it first stops colliding so that I can add and remove options from my flight menu when they're in and out of range. Is there a simple way to get an array of the objects that a sprite is currently colliding with? Link to comment Share on other sites More sharing options...
MichaelD Posted June 13, 2015 Share Posted June 13, 2015 You can add the object to an array of "detected objects" and return false on the collider event handler while it is "in range" and remove it from the array when it leaves the range. Link to comment Share on other sites More sharing options...
Recommended Posts