问题描述
我已经在我的无尽跑酷游戏中实现了一个实例化生成系统。我想在父游戏对象中有一个游戏对象,以尽可能地跟随玩家,并且当父游戏对象在池中被回调时不会消失。
我不知道这是否可能。如果没有,请指点我去哪里
解决方法
好吧,您可以通过简单地更改其 Transform.parent
theChild.transform.parent = null; // or any other Transform
或者您可以通过 Instantiate
创建一个孩子的克隆,例如
Instantiate(theChild,theChild.transform.position,theChild.transform.rotation);