How can a client instantiate a scene object?

Hello
I just have a quick question, I am fairly new to networking in unity and have been working on a survival game for the past few months, just wondering if there is any way to have a client instantiate a scene object?

Any help is greatly appreciated!

Comments

  • Hi,

    If you mean scene object in terms of PUN, use PhotonNetwork.InstantiateSceneObject instead of PhotonNetwork.Instantiate.
    This works only on master client.
  • Thank you for the replay, I am wondering if there is any way possible to have the client instantiate a scene object instead of the master? Or maybe the client can send an RPC to the master to instantiate a scene object, however it keeps throwing an error at me saying that the "Client is not the master in the room"
  • Anyone have any solutions?
  • Exactly as you wrote, non-master client should send RPC to a master (with PhotonTargets set to MasterClient), master spawns scene object in RPC handler.