Search Unity

Resolved Relay Client not switching Scene

Discussion in 'Multiplayer' started by MoukySenpai, Jul 23, 2022.

  1. MoukySenpai

    MoukySenpai

    Joined:
    Jun 22, 2022
    Posts:
    1
    Hello Guys !

    I'm trying Unity Relay for my small game.
    I did a setup to test, and everything was find after some error and retry.

    But there is still one thing that does not work : Scene switching.

    I have 2 Scenes : MainMenu and Game
    I have 2 projects opened : the main one, and the copy one (made with ParrelSync)

    On the MainMenu Scene, I can host a game, or join a game
    In this scene, I have my buttons + NetworkManager + ProjectSceneManager

    When I host a game, the client create the host relay, get the join code, switch to the scene Game, spawn a player gameobject and everything is fine.
    Then, when I try to join, the client is connected to the host, but do not switch to the scene Game.
    Still, the game object of player 2 is spawn, everything looks fine on host side, I also have the response from the "OnSynchronize" (NetworkManager.SceneManager)

    I just don't understand why my client does not want to switch to the Game scene.
    PS: I have no error on log.

    EDIT :
    When I try to stay on the same scene, everything is fine
    Plus, I didn't realize, but my event "synchronized complete" was not trigger in the switch scene scenario.

    EDIT2 : SOLVED !
    I don't know what happened, my code was ok.
    Maybe some compilation problems, or I don't know.
    I put all my GameManager code in comment : it worked
    then I added back my code step by step until everything was back
    aaaaand, it worked

    I don't know if there is something in Unity to "clean" or do a full recompile, I don't know. But now it's woking.
     
    Last edited: Jul 24, 2022