I have implemented an instantiation spawn system into my endless runner game. I want to have a gameObject inside a parent gameOject to follow the player as far as it needs to and not disappear when the parent gameobject is called back in the pool.
- what i really need to do is, create a copy of a child gameObject and have it still exist when the parent is deleted.
I don’t know if this is possible. If not, point me where to go
When you destroy the parent, detach the child you wish to keep alive by setting its transform.parent = null.
2 Likes
This is what I would do ^^^^ But an alternative approach is to not have the child be a child at all, and just have it follow the parent in code. How I normally do that is have an empty GameObject I call a mount point as a child of the parent. The object which is following just sets its postion/rotation to match the mount point every frame in Update.
1 Like