I have tried unparenting it before destruction, and removing all children from the prefab base. these are the only two answers I can find online. and despite trying each about 3 different ways, I cant figure out how to keep the object I want to destroy from being permanently deleted from all future instances of the prefab.
for context, I’m repeatedly spawning the same prefabs, and its important the destroyed object respawns
Hi @cloverkitty8 Why are you trying to destroy a child of a prefab, rather than destroying a child of an instance of a prefab? Destroying the child object of a prefab will most definitely destroy it for all instances created from that prefab. But, destroying a child object of an instance of a prefab won’t have any impact on the source prefab (if I am wrong, someone please correct me). I’m also not sure how a prefab would be able to have a collision.
Also, I’ve had some issues in the past using SetParent(null)
. Due to that, I always assign parent = null
instead.