I am wondering if you can destroy an object at a spot, like “Destroy (x,y,z)”? I am placing prefabs in gamespace, but would like to destroy them. I can keep track of what is at their position, but not manipulate the object further after placement. Maybe add a script to each when placed to keep track? I don’t know. If you need to see my code I can show.
Couple of ideas:
One, keep a list of your gameobjects that might be destroyed and iterate through and check their distance to the location. If it’s close enough, destroy it. This is the brute force method, but depending on your game, it might be perfect.
Second, keep all your gameobjects that may be destroyed on a Physics Layer, like “Destroyables”. When you want to destroy at a location, place a sphere collider or use a spherecast, and check for the Destroyable layer. If found, destroy it.