Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Sharing non prefabs across multiple users via PUN

Discussion in 'Multiplayer' started by athenarcxanthi, Jul 4, 2022.

  1. athenarcxanthi


    Apr 15, 2022
    Hello! I am developing an app for Hololens 2 and I am currently stuck in a sharing related issue. I am using Photon to do the sharing, and PhotonNetwork.Instantiate() can create game objects from prefabs which include the PhotonView script component, along with the components that give them the functionality I need.

    The problem arises in my need to let the users find 3d models from an in-app file browser or an internet browser and load them to the scene, as these new models include only graphics related information. PhotonNetwork.Instantiate() can instantiate only prefabs, which i cannot process and save at runtime. I tried to manually instantiate a 3d model, which allowed me to add components to it before sharing, but this method requires all users to have access to the specific 3d model.

    Excuse me for missing an obvious way around the problem. I am kinda newbee.

    Both PhotonNetowork.Instantiate() and manual instantiation can be found here:
  2. tobiass


    Apr 7, 2009
    It's possible to create a "base" networked object with all the network functionality in it plus a script that loads and assigns a 3d model when it's being instantiated or changed. You'd share the url for the character for a networked object and everyone would have to load and apply it.