- Home /
Photon Instantiate Group's, Instantiating Prefabs that should already Exist
I have a post for this as well on the exitgame forums: http://forum.exitgames.com/viewtopic.php?f=17&t=5646&p=21547#p21547
My issue is that, if somebody instantiates a photon network gameobject in say group 2, and somebody new does the same, everyone currently in the group can see the new instantiated object, whereas the new client instantiated into the group does not see what is already there.
It works the opposite way as well, if you destroy your gameobject from a group you're leaving, you can still see all the network objects who you were just with, even though you've stopped sending/receiving messages from that group (so they just sit there)
I need some kind of way, to turn these objects on and off based on if you're in their group or not. That way they always exist and you can pick up and leave off in their group's message stream.
Anybody have any thoughts on this please? It's killing me!
Answer by tobiass · Jan 28, 2015 at 07:38 AM
PUN does not implement caching of the events used for Instantiate. The client would have to store all (!) instantiate events unless they are destroyed. When entering a group, the client could replay the fitting events and when it leaves the group, the fitting GameObjects could be cleared.
This is a customization of PUN which takes a bit of effort but is doable.
Let's discuss in the forum thread you linked in the question.