can not instantiate before the client joined/created a room. state: peercreated

Options

Basically I made a diffrent scene from the scene with all the menus and their is a button with a script that sends the player to the menu scenes here is the code

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.SceneManagement;


public class SceneSwitcher : MonoBehaviour

{

   // Start is called before the first frame update

   void Start()

   {


   }


   public void multiplayer() {

       SceneManager.LoadScene(sceneBuildIndex:1);

   }

}

Answers

  • Tobias
    Options

    You may want to read and code-along the PUN Basics Tutorial.

    While SceneManager.LoadScene works in a single player game, the tutorial will show you the networked alternative to this (and explain a few other details needed to sync scenes).