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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Third Party Help spawning players in a case like this! [PhotonPUN]

Discussion in 'Multiplayer' started by Ciava, Jun 15, 2022.

  1. Ciava


    Jun 1, 2018

    I am a Newbie with Unity and even a worst newbie with Photon PUN. I have a situation like this. I want two players challanging each other. Lets say CAT vs. DOG.

    In the Lobby players connecting the network will chose to be a CAT or a DOG.

    The player who chose CAT creates a room and wait for a DOG to join.

    The player who chose DOG receive in his screen a list of the available rooms (created by CATS). When the DOG enters a room, the room is == 2 and the game begins.(automaticallysyncscene?)

    Now I am asking: How to spawn players? Player A is CAT, Player B is DOG but how to spawn player A as a CAT and PLAYER B as a DOG?

    I need to have TWO prefabs (A cat and a dog) but I can't understand how to give the right character to the right player.

    How would you script a "SpawnManager" in a case like this?