Search Unity

Third Party Problem with PhotonNetwork.Instantiate

Discussion in 'Multiplayer' started by gurman22788, Apr 30, 2023.

  1. gurman22788

    gurman22788

    Joined:
    Feb 3, 2023
    Posts:
    3
    I want to implement a character selection system and
    upload it to the stage. I created prefabs and threw them into the list, then into PhotonNetwork.Instantiate specified the player and his ID. I'm working with multiplayer for the first time and I don't fully understand how PhotonNetwork works.Instantiate only with prefabs directly or can extract them from arrays and lists on its own, help with the problem, I will be very grateful.
    upload_2023-4-30_21-26-19.png upload_2023-4-30_21-27-13.png upload_2023-4-30_21-27-39.png upload_2023-4-30_21-28-31.png
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,068
    PUN instantiation is the same as Unity's but it is networked. You instantiate prefabs with PhotonViews on, which then identify and run the networking per object.
    It is a bit much to explain here but there is a tutorial for PUN 2, which you should check out. It covers instantiation and some pitfalls of that, too. Networking is something that is hard to get right without learning about it before you start.
    https://doc.photonengine.com/pun/current/demos-and-tutorials/pun-basics-tutorial/intro