Can Photon cause a gameobject to get disabled?
Options
- I am seeing some very strange behavior in Unity. When I join a room, sometimes one of the gameobjects with a Punbehaviour attached gets disabled. This only happens when I join an existing room (and that too not always) but never when I create a room.
- I have checked my code thoroughly using breakpoints and debug logs and I am sure that my code is not disabling that gameobject.
- Is there any precedence of Photon showing this kind of behavior, i.e. disabling gameobjects?
- Just to give an idea of the setup: I have two punbehaviors in the scene attached to two different gameobjects.
- Both of them are subscribed to some of the usual Photon callbacks like OnJoinedRoom, OnPhotonPlayerConnected etc. Could this be causing the problem?
- I am using PUN 1.0 and Unity 2018.3.0
I can change the architecture to work with just one Punbehaviour and see if that fixes the problem but it's going to take significant effort. If anybody can confirm encountering this kind of bug before then I would feel a lot better changing up the architecture.
Thanks.
- I have checked my code thoroughly using breakpoints and debug logs and I am sure that my code is not disabling that gameobject.
- Is there any precedence of Photon showing this kind of behavior, i.e. disabling gameobjects?
- Just to give an idea of the setup: I have two punbehaviors in the scene attached to two different gameobjects.
- Both of them are subscribed to some of the usual Photon callbacks like OnJoinedRoom, OnPhotonPlayerConnected etc. Could this be causing the problem?
- I am using PUN 1.0 and Unity 2018.3.0
I can change the architecture to work with just one Punbehaviour and see if that fixes the problem but it's going to take significant effort. If anybody can confirm encountering this kind of bug before then I would feel a lot better changing up the architecture.
Thanks.
0
Answers
-
hi @JohnTube
Both the objects are already present in the scene, they are not network instantiated. Neither of them has a PhotonView component. One of the objects is disabled in the scene by default and is enabled dynamically based on user input.
What triggers this 'automatic clean up' by PUN?0 -
Never mind, I think the behaviour that I was seeing was due to some issue with automatic scene syncing. I am now syncing the scene manually and the issue seems to have gone away.
Thank you for your input0