Interactable object by many players

Hi!

How can I create a GameObject that is interactable (movable) by all players?

Currently I am creating GameObject with a PhotonView, but just the owner can interact with them (eg: change its position).

Thanks!

Comments

  • Request interactable object ownership before you move it:
    photonView.TransferOwnership(id);

    Id is could be player photonView.OwnerActorNr

    Lastly change interactable object pv settings to request. I hope it helps for you.
  • Thanks a lot!
    I will give it a try. So there is not such concept as a owned-by-all object?
  • L3sc
    L3sc
    edited February 2020
    AFAIK no. Doc says:
    In PUN, every object can only be controlled by one client. When a client instantiates something, it will be the owner of that new object, PhotonView.isMine is true on that client only and if you use OnPhotonSerializeView, only this client will write to the PhotonStream. The others just receive and update accordingly.

    If you have scene object with photonView -> owner is scene and controller is master client. Otherwise which client instantiate something owner and controller is that client but you can take ownership all of them by requesting.