MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

Question: Isn't MRTK supposed to handle level loads?

Open Alexees opened this issue 7 years ago • 4 comments

Overview

I was wondering how the MRTK vNext is supposed to handle level loads. When I load a scene non additively, the motion controller that was detected in a previous scene just goes away and does not come back. Seems it's not DontDestroyOnLoad. Shouldn't the toolkit be scene-load-proof?

Scenario: The main reason for this the fact that the UNET NetworkManager uses LoadLevel

Mixed Reality Toolkit Release Version

mrtk_development

Alexees avatar Mar 11 '19 13:03 Alexees

This issue has more info / discussion on scene loading: #3261

The main reason for this the fact that the UNET NetworkManager uses LoadLevel

In our projects we've dealt with the UNET limitation by writing a NetworkManager class which uses additive loading and enforces the active scene via SetActiveScene. As long as our synced objects either exist in the active scene on startup or are network-instantiated into that scene they should function normally.

Railboy avatar Mar 11 '19 17:03 Railboy

Yeah I always found it odd that Unity would always promote additive level loading but then force people to use the network manager that didn't follow that guideline.

My personal workflow:

  • Have a base scene that includes the initial setup with the MixedRealityToolkit, and any persistent GameObjects.
  • When working in the editor you can have multiple scenes open at once. I generally open the base scene then find and drag my additive scene into the hierarchy then do what I need to.

image

Now, should the mrtk handle level loading? Theoretically it could be added as another service, and I could see this being beneficial, but also might be as annoying as the service locator to those who also question its usefulness. Up to you as the developer I suppose.

One could implement it solely in the base scene as a strictly UI/UX component. I'd propose we setup all the demo scenes in this manner to show off how to handle multi-scene development.

StephenHodgson avatar Mar 11 '19 19:03 StephenHodgson

This issue has more info / discussion on scene loading: #3261

The main reason for this the fact that the UNET NetworkManager uses LoadLevel

In our projects we've dealt with the UNET limitation by writing a NetworkManager class which uses additive loading and enforces the active scene via SetActiveScene. As long as our synced objects either exist in the active scene on startup or are network-instantiated into that scene they should function normally.

@Railboy Do you mind sharing that NetworkManager?

Alexees avatar Mar 12 '19 08:03 Alexees

looks like this is addressed as part of Lars' multiscene work. Please reopen if it still repros with the latest Unity 2018 + MRTK release

Yoyozilla avatar Jul 24 '19 04:07 Yoyozilla