Lukas - CryoCorp
New member
Hello,
I've encountered an issue where, if the local player disconnects, his instantiated character gets moved to the ObjectPool. If he reconnects, it gets moved back into the scene. This works flawlessly as long as there is only one PhotonView at the root of the character. If I create a child, let's say, for example, a particle system which should cause a respawn effect, and give it a PhotonView, this child gets destroyed, and then the parent gets moved to the ObjectPool. Unfortunately, the code responsible for this is ObjectPoolBase, which is hidden inside the .dll, and I haven't been able to conclusively understand how PunObjectPool is preventing the parent from getting destroyed but not the child.
So far, so good. I thought I could just use the traditional way of destroying and instantiating, but somehow the parent always ends up in the ObjectPool and gets stuck there if I instantiate a new character upon reconnect. If I do it twice, the Unity install freezes completely.
Now, my question is: How can I either protect the children with a PhotonView from destruction as the parent is protected, or how can I disable my character as a whole from getting moved to the object pool? I would prefer the first option though since it would make integration easier.
I hope this is understandable. If not, I'll shoot a video of the problem and upload it.
I've encountered an issue where, if the local player disconnects, his instantiated character gets moved to the ObjectPool. If he reconnects, it gets moved back into the scene. This works flawlessly as long as there is only one PhotonView at the root of the character. If I create a child, let's say, for example, a particle system which should cause a respawn effect, and give it a PhotonView, this child gets destroyed, and then the parent gets moved to the ObjectPool. Unfortunately, the code responsible for this is ObjectPoolBase, which is hidden inside the .dll, and I haven't been able to conclusively understand how PunObjectPool is preventing the parent from getting destroyed but not the child.
So far, so good. I thought I could just use the traditional way of destroying and instantiating, but somehow the parent always ends up in the ObjectPool and gets stuck there if I instantiate a new character upon reconnect. If I do it twice, the Unity install freezes completely.
Now, my question is: How can I either protect the children with a PhotonView from destruction as the parent is protected, or how can I disable my character as a whole from getting moved to the object pool? I would prefer the first option though since it would make integration easier.
I hope this is understandable. If not, I'll shoot a video of the problem and upload it.