Elevate local GameObject to network

Hey all,

I'm try to build an online AR game with Vuforia and had a question about what is the best practice for my situation.

When a player GameObject is instantiated, a Vuforia model target is instantiated with it. Problem is, Vuforia usually identifies the object before the player enters a room and that creates sync problems.

For now I instantiate an offline double until I have network connection and then I destroy my local object and instantiate using PhotonNetwork.Instantiate().

Is there a better way to do this? can you elevate a local object to be a network object?

Thank you

Answers

  • Yes, you can turn a local object into a networked one. You need to apply a PhotonView, allocate a viewID and sync that, so everyone else does the same. The key point is that you need to tell everyone else which avatar to load and then apply a PhotonView with specific viewID of yours.

    There is a doc about Manual Instantiation. Hope this helps.