0

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

Ramesh Madara
  • 11
  • 1
  • 5

1 Answers1

2

Well, You could either simply detach the child from the parent before it gets destroyed by simply changing its Transform.parent

theChild.transform.parent = null; // or any other Transform

or you could create a clone of the child via Instantiate e.g

Instantiate(theChild, theChild.transform.position, theChild.transform.rotation);
derHugo
  • 83,094
  • 9
  • 75
  • 115