Hia folks,
I have a sprite which follows the mouse (a "placeholder" for a building to be built). I have placed some invisible sprites on the ground which are meant to be a building base (buildings can only be placed on those bases).
I want my placeholder to snap to an image point of each building base sprite when the mouse is around. So far, I made a rudimentary system with a simple mouse over condition:
but the results are buggy at best. The placeholder is snapping, but not always, and not where it should.. I have also checked the collision polygons of both sprites. Made a quick capture below:
https://i.imgur.com/0g6Bigd.gif
The white rectangles are the base sprites, they are visible for testing purposes
Any ideas on a reliable method for snapping to an image point are appreciated!