Change Photon View owner to scene on start

Options
Hello!
I am currently working on a multiplayer survival game. Players are able to build bases and secure them as best they can from other players. However, I have already tried using the PhotonNetwork.instantiate and the objects are destroyed when the new player joins. My actual question, is there a way to change the photon view owner to the scene when the object is instantiated? I need each view ID of the scene to be unique.

Comments

  • vadim
    vadim mod
    edited January 2016
    Options
    Hi,

    Use PhotonNetwork.InstantiateSceneObject on master client to create "scene" objects which stays in scene while room exists. Or set PhotonNetwork.autoCleanUpPlayerObjects to false on any client to preserve all objects created by this player even after player leaves.
  • RenegadeGames
    Options
    Thank you for the reply, greatly appreciated.
    May I ask if there is anyway for the client to instantiate scene objects? Maybe sending an RPC to the master then the master sending an RPC to instantiate a scene object?
  • vadim
    Options
    Yes, the only way to trigger scene object instantiation from non-master client is to ask master to do so. You can do it with RPC (better sent to master only) . Master calls PhotonNetwork.InstantiateSceneObject() then.
  • RenegadeGames
    Options
    Would I need the master photon view in order to send an RPC from the client to the master request to instantiate a scene object? For example if the client needs to build a base and presses a key to build the base. Would I simply need to call:
    PhotonNetwork.RPC (pv, "BuildBase", PhotonTargets.MasterClient,false,null); ?

    Sorry for so many questions, I am new to networking.

    Thank you for the reply's.