-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Labels
priority:mediumThis issue has medium priority and may take some time to be resolvedThis issue has medium priority and may take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report
Description
Description
When using automatic scene management, SceneName is inconsistently reported in NetworkSceneManager.OnSceneEvent.
Reproduce Steps
- Enable automatic scene management
- Subscribe to
NetworkSceneManager.OnSceneEventinnetworkManager.OnClientStarted - Load a scene via
NetworkSceneManagerby passing in a full scene path (e.g.,Assets/Scenes/GameScene_02.unity) - Track
SceneEvent.SceneNameandSceneEvent.Scenearguments inOnSceneEventcallback
Actual Outcome
SceneEvent.SceneName in some event types contains the full scene path, in some only the scene name.
Expected Outcome
SceneEvent.SceneName should always be consistent - contain the full scene path or the scene name all the time.
Environment
- OS: Windows 10
- Unity Version:
6000.0.47f1 com.unity.netcode.gameobjectsversion:2.3.2com.unity.services.multiplayerversion:1.1.2- Distributed authority, using sessions
Additional Context
I'm using distributed authority:
var multiplayerService = MultiplayerService.Instance;
var options = new SessionOptions
{
Name = multiplayerSessionNameId,
MaxPlayers = 10,
IsPrivate = false,
IsLocked = false,
}.WithDistributedAuthorityNetwork();
await multiplayerService.CreateOrJoinSessionAsync(multiplayerSessionNameId, options);Loading the scene as follows:
var scenePath = SceneUtility.GetScenePathByBuildIndex(index);
Debug.Log($"Starting to load scenePath={scenePath}");
sceneManager.LoadScene(scenePath, LoadSceneMode.Additive);Tracking the OnSceneEvent the following way:
private void OnSceneEvent(SceneEvent sceneEvent)
{
var sceneName = sceneEvent.SceneName;
var eventType = sceneEvent.SceneEventType;
var scene = sceneEvent.Scene;
Debug.Log($"{eventType}: sceneName={sceneName}, scene.name={scene.name}, scene.path={scene.path}");
}Log lines that get printed:
Starting to load scenePath=Assets/Scenes/GameScene_02.unity
Load: sceneName=Assets/Scenes/GameScene_02.unity, scene.name=, scene.path=
LoadComplete: sceneName=GameScene_02, scene.name=GameScene_02, scene.path=Assets/Scenes/GameScene_02.unity
LoadEventCompleted: sceneName=GameScene_02, scene.name=, scene.path=
Metadata
Metadata
Assignees
Labels
priority:mediumThis issue has medium priority and may take some time to be resolvedThis issue has medium priority and may take some time to be resolvedstat:importedStatus - Issue is tracked internally at UnityStatus - Issue is tracked internally at Unitytype:bugBug ReportBug Report