Under what circumstances will a child object block the destroy call on a parent?
I have some code which has been working fine until I added a script to an underlying child, which is only updating it’s own position and scale, but now the parent destroy command does nothing.
The destroy command is already a workaround, because there is a particle system started at the same time I have to set a timer flag and destroy the object by checking that flag in the following updates, in the mean time the object is moved out of the scene.
As I say, this was all working fine until I put code on the child. Rather than go through the hell of taking out a line of code at a time and waiting 20 seconds for the thing to compile I thought I’d ask here!
Instead of your troubleshooting method, I’d instead immediately before the Destroy call add a Debug.Log line which includes the GameObject.name of the GameObject you are about to destroy. Then run your game, and verify:
The correct object appears in the console as the one to be destroyed
That no console errors appear
That in later frames the object is or is not destroyed
If you’re still having trouble, I suggest posting the script here using CODE tags.