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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Unity Multiplayer 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?