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.

Photon issue

Discussion in 'Multiplayer' started by stefan_loefven, Sep 25, 2022.

  1. stefan_loefven

    stefan_loefven

    Joined:
    Nov 9, 2020
    Posts:
    1
    I have a problem with my photon. I was following this tutorial:
    and reached 4 minutes where a problem occured. It doesn't load into the lobby scene. The scene's name is correct and everything and I have tried everything I could come up with.

    Here is my script and I hoping one of you guys could help me find the issue

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using Photon.Pun;
    using UnityEngine.SceneManagement;

    public class ConnectToServer : MonoBehaviourPunCallbacks
    {

    private void start()
    {
    PhotonNetwork.ConnectUsingSettings();
    }

    public override void OnConnectedToMaster()
    {
    PhotonNetwork.JoinLobby();
    }

    public override void OnJoinedLobby()
    {
    SceneManager.LoadScene("Lobby");
    }

    }
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,957
    Maybe the Scene is not in the Level Index? Check the build settings.