My simple 2D object isn't colliding before it gets destroyed
Hi guys, I'm pretty new to Unity. I am making a 2D game where I want an object I'm dragging to be destroyed after I release the mouse button, but I want it to try collide with something first. I want my game to be able to say "I collided!" to let me know it collided and then destroy itself. The problem is, whenever I try, it always seems like the destruction occurs before the collision no matter what, but if I comment out the destruction I can see that it DOES collide, but never before it gets destroyed if I put it back in the code. Please help me find a solution since I have been stuck on this for hours.
I hope this is enough information, but there is also a more detailed explanation if it is not. I have a UI. When I click this UI, an object spawns at my cursor and lets me drag it onto my scene. When I release my cursor, I want a new object to spawn and snap to a grid closest to where I let go of the mouse. I have already accomplished this part. The problem is that I can't destroy the temporary sprite I was dragging. I can put the destroy function inside of OnCollisionEnter2D, but this does not destroy the object if I don't drag it over a place it can snap to.
Your answer

Follow this Question
Related Questions
OnCollisionEnter2D is called after object was shifted 1 Answer
I want my player to walk through walls 1 Answer
Layer Collision 0 Answers
[Unity2D] Collision bug 0 Answers
enemy and player do not collide 0 Answers