Hi Toni,
Can you help me a little? Here is the scenerio:
I have a few smaller scenes, and I want to make it transition faster between them.
Essentially, the way I want to make it work is to tell a scene portal, that load the destination scene which is typed in the editor additive, and only load that scene when I enter the portal. I know how to make an async loading work, but not with the quest machine's scene portals.
I won't even need the scene transition animation, just to make it more snappier.
Is there a way to do that?
Scene Portals with asynchronous scene transitions
Re: Scene Portals with asynchronous scene transitions
Hi,
You essentially want to stream parts of the world in and out as the player moves around? If so, you can make a subclass of ScenePortal and override the UsePortal method. Example:
You'll probably also want a script that unloads an additively-loaded scene when the player gets to a position that's far away from the scene. In that script, use SaveSystem.UnloadAdditiveScene().
SaveSystem.LoadAdditiveScene and UnloadAdditiveScene are like Unity's additive SceneManager.LoadScene/UnloadScene methods, except they also maintain save data properly.
Alternatives are to use the free but basic Scene Streamer asset, or the more advanced but paid SECTR Stream or World Streamer. If you use any of these alternatives, you'll need to write some code that tells the SaveSystem to record outgoing scenes' savers, and to apply saver data to savers in newly-loaded scenes.
You essentially want to stream parts of the world in and out as the player moves around? If so, you can make a subclass of ScenePortal and override the UsePortal method. Example:
Code: Select all
public override void UsePortal()
{
if (isLoadingScene) return;
isLoadingScene = true;
onUsePortal.Invoke();
//-- Don't use this: LoadScene();
SaveSystem.sceneLoaded += OnSceneLoaded;
SaveSystem.LoadAdditiveScene(destinationSceneName);
}
private void OnSceneLoaded(string sceneName, int sceneIndex)
{
isLoadingScene = false;
SaveSystem.sceneLoaded -= OnSceneLoaded;
}
SaveSystem.LoadAdditiveScene and UnloadAdditiveScene are like Unity's additive SceneManager.LoadScene/UnloadScene methods, except they also maintain save data properly.
Alternatives are to use the free but basic Scene Streamer asset, or the more advanced but paid SECTR Stream or World Streamer. If you use any of these alternatives, you'll need to write some code that tells the SaveSystem to record outgoing scenes' savers, and to apply saver data to savers in newly-loaded scenes.
Re: Scene Portals with asynchronous scene transitions
Hey,
Thank you Tony, I've made it work!
Thank you Tony, I've made it work!
Re: Scene Portals with asynchronous scene transitions
Happy to help! I'm glad you made it work.