com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

MultiplayerService.CreateOrJoinSessionAsync sometimes returns before SceneManager is ready

Open afarchy opened this issue 1 year ago • 3 comments

Description

I'm hitting an error here that I don't understand in joining a distributed authority session, where after the session joins, the SceneManager is null.

  • This doesn't always happen.
  • Never seen this in editor, only on device. We're using Meta Quest 2/3.
var options = new SessionOptions()
{
    Name = sessionName,
    MaxPlayers = 64,
}.WithDistributedAuthorityNetwork();

_currentSession = await MultiplayerService.Instance.CreateOrJoinSessionAsync(sessionName, options);

if (NetworkManager.Singleton.SceneManager == null)
{
    Debug.LogError("Why is this happening?");
}

Reproduce Steps

  1. See code above

Actual Outcome

NetworkManager.Singleton.SceneManager is null.

Expected Outcome

NetworkManager.Singleton.SceneManager is not null.

Environment

  • OS: Meta Quest 2/3 (Android)
  • Unity Version: 6000.0.23f1
  • Netcode Version: 2.1.1
  • Netcode Commit: [e.g. https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/commit/d218b2992ddb98f2eb1a06b9085724ca33352865]

afarchy avatar Dec 02 '24 21:12 afarchy

Invasion of Kaldheim // Pyre of the World Tree - (Gatherer) (Scryfall) (EDHREC)

{3}{R} Battle — Siege (As a Siege enters, choose an opponent to protect it. You and others can attack it. When it's defeated, exile it, then cast it transformed.) When this Siege enters, exile all cards from your hand, then draw that many cards. Until the end of your next turn, you may play cards exiled this way. :arrows_counterclockwise: Enchantment Discard a land card: This enchantment deals 2 damage to any target. Whenever you discard a land card, exile the top card of your library. You may play that card this turn.

github-actions[bot] avatar May 19 '25 20:05 github-actions[bot]