I'm making a tile based building game, the tiles are based on a tile map, and the buildings are sprites with an area2D and collision shape in their own scenes, the buildings are instanced in the main scene at another sprite that follows the tilemap's tiles (acting as the grid snap) when the button is clicked and it will place down the building that corresponds to a value. When placing down buildings they can overlap and it's obvious they do because they are animated sprites.
I first tried the area2D and when another area2D entered it, it would delete it's self but it wouldn't replace the previous building and it was also very unreliable, it would work sometimes and not other times. I tried an input event, on self clicked delete self, but that didn't work.
I tried loading the scene into a seperate value and did replace_by(BuildingData.buildingToPlace), but that returned a null or a nill or something else.
What I need to figure out is if another instanced scene is in the position that I'm placing the new instanced scene, and how to delete or replace the old instanced scene for the new instanced scene to be placed.
Thanks in advance! :D