Search Unity

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

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

  1. Ciava

    Ciava

    Joined:
    Jun 1, 2018
    Posts:
    50
    Hello!

    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?


    Thanks!