Search Unity

Question Switching Scenes

Discussion in 'Multiplayer' started by Deleted User, Sep 22, 2021.

  1. Deleted User

    Deleted User

    Guest

    new to multiplayer in unity. I am trying to create a host button that makes it go to a different scene, where the player spawn in.
     
  2. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Code (Csharp):
    1.  
    2. SceneManagrer.LoadScene("Scene name here");
    3.  
     
  3. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    Also, are you doing a mutiplayer game? If you are a begginer you shouldn't make one.
    I consider myself as a medium-advanced gamedev and I still have problems with multiplayer.
    Try out singleplayer
     
  4. somedevelopergg

    somedevelopergg

    Joined:
    Oct 29, 2020
    Posts:
    25
    its a complicated thing, i dont even know how exactly do it.
    but something like that:

    save the players data,
    delete the player,
    load another scene,
    spawn the players.

    there is many things to do it work, sadly.
     
  5. Deleted User

    Deleted User

    Guest

    how do i spawn the player into a different scene.
    this is what i did but did not work. i made two C# one for host button where it start hosting the server and the second one is for changing the scene. but when i try clicking the button and load the scene but no player was not spawning.
     
  6. r31o

    r31o

    Joined:
    Jul 29, 2021
    Posts:
    460
    The problem will be that there is not any player in that scene.
     
  7. Deleted User

    Deleted User

    Guest

    do i have to make a script where you have to delete the player from the main menu on to the level scene?