How to unload a scene loaded with LoadSceneAsync?
Hello,
I'm preloading different scenes depending on player's position on map. The scenes are loaded when the player crosses a trigger, and when he actually gets at the point where the new scene needs to be loaded it just switches to it. This works fine so far, but if the player enters the trigger multiple times without actually switching, the scene is loaded multiple times. I have the name of the next scene, but using SceneManager.UnloadScene(sceneToUnload) doesn't work. See the below screenshot from the Hierarchy while in play mode. Please help me find a way to unload these scenes. Thanks.
Your answer

Follow this Question
Related Questions
Best Way To Return To Main Menu In This Situation... 1 Answer
Script for unloading assets and textures? 0 Answers
Resources.unload on scriptable object resets it's prefab references 0 Answers
Are My AssetBundles Being Unloaded On Me Without My Doing So? 0 Answers
Resources.UnloadAssets doen't deallocate memory in build 0 Answers