Forum rules - please read before posting.

Addressable preload?

Hi all!

As the title we're looking for a method to preload scenes that are Addressables.

Out title will be cross platform, Switch included, so using Assetbundles and Addressable is very important.

Anyone else has found the same problem and solved it?

Thank you in advance!

Comments

  • Welcome to the community, @Magistrix.

    Exactly how assets and bundles are accessed in a game will vary from project to project, so it may be that custom code is necessary to handle things.

    Unity's DownloadDependanciesAsync function allows you to cache an Addessable's dependencies:

    Addressables.DownloadDependanciesAsync (sceneAssetKey);
    

    However, local AssetBundle caching isn't supported on the Switch - see Unity's docs on this here.

    AC's own Preload only? option currently only works with scenes added to Unity's Build Settings. I will look to see if this can be expanded to include Addressables, but bear in mind that it will likely have the same caveat in that it should generally only be used if you're certain that the preloaded scene will be next.

  • Hi Chris, thanks for your answer!

    Yes I was talking about AC Preload Only option.

    However I did a custom script for preloading using addressable and it's working fine except if we add a scene in additive mode instead of single mode.

    In single mode calling KickStarter.eventManager.Call_OnAfterChangeScene(LoadingGame.InNewScene); the gameflow is ok (the player is on the playerStart, on start actionLists works fine etc).

    But if the scene is added this doesn't happen, there is any suggession/workflow if a scene is added?

  • Is this in the case of adding an additional scene through gameplay?

    The OnAfterChangeScene event shouldn't be called when involving additive mode - this is reserved for when the active scene is changed out, rather that when additional scenes are added as sub-scenes.

    When adding a sub-scene, the Player isn't intended to be added to the PlayerStart - as they're assumed to be mid-gameplay at this point.

    Instead, the OnAddSubScene will fire. This should be handled automatically if AC detects an AC scene is added to the game without replacing the main scene.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.