Hi,
I'm trying to use addressable feature for my scenes
I did the following:
In the AddressableBuildSetting: I changed Build Addressable Content on player build
to Do not build Addressable content on player build (to save time each time I do build)
I did full build of the addressable group, and then build of the game
when the game run the command Restart Game with scene name equal to its addressable name
I get this error in the log:
"Scene 'Academy' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded. To add a scene to the build settings use the menu File->Build Settings..."
Since I want to use addressable it doesn't make sense to add it to the build setting (or using AssetBundle...)
Am I missing something? or it should not work like this.
PS
It doesn't work also with Load Game but works fine using the action - Scenes->Switch with name)
AC version: 1.75.2
Unity version: 2021.3.0f1
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
More changes I forgot to mention:
Load Scenes From Asynchronously - checked
Load Scenes From Addressable - checked
**AddressableIsPresent ** added to Script Define Symbols
after first scene loaded I added a script that load the main menu
with this line:Addressables.LoadSceneAsync(sceneToLoad)
I will attempt a recreation.
Can you share the Console error messages in full - both for when you restart the game, and load the game.
This is the full Player log of when running Restart Game command:
Mono path[0] = 'D:/POTD_Unity_03_01_21/Build/New folder (9)/Plot of the Druid_Data/Managed'
/POTD_Unity_03_01_21/Build/New folder (9)/Plot of the Druid_Data/UnitySubsystems
Mono config path = 'D:/POTD_Unity_03_01_21/Build/New folder (9)/MonoBleedingEdge/etc'
Initialize engine version: 2021.3.0f1 (6eacc8284459)
[Subsystems] Discovering subsystems at path
GfxDevice: creating device client; threaded=1; jobified=0
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: AMD Radeon R9 200 Series (ID=0x6810)
Vendor: ATI
VRAM: 2027 MB
Driver: 27.20.21003.1028
Begin MonoManager ReloadAssembly
Initializing input.
Input initialized.
D3D11 device created for Microsoft Media Foundation video decoding.
Initialized touch support.
UnloadTime: 14.366900 ms
Loading: Start
Unloading 5 Unused Serialized files (Serialized files now loaded: 6)
UnloadTime: 5.233000 ms
PlayerPrefs Key 'AC_PlotOfTheDruid_0' loaded
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
A local EventSystem object was found in the scene. This will override the one created by AC, and may cause problems. A custom EventSystem prefab can be assigned in the Menu Manager.
-> AC debug logger
Spawned instance of Player 'Jase'.
-> AC debug logger
Game version: 4.4.0
-> AC debug logger
SpriteAtlasManager.atlasRequested wasn't listened to while SkunkFart requested.
Loading: End
Canvas group not initialize
Unloading 10 unused Assets to reduce memory usage. Loaded Objects now: 18276.
Total: 28.701000 ms (FindLiveObjects: 1.623400 ms CreateObjectMapping: 1.518500 ms MarkObjects: 25.395300 ms DeleteObjects: 0.163100 ms)
Unloading 3 Unused Serialized files (Serialized files now loaded: 6)
loading screen not initialize
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 17.395000 ms (FindLiveObjects: 1.924500 ms CreateObjectMapping: 1.971700 ms MarkObjects: 13.460500 ms DeleteObjects: 0.038100 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 6)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 15.655300 ms (FindLiveObjects: 1.727900 ms CreateObjectMapping: 1.013400 ms MarkObjects: 12.874200 ms DeleteObjects: 0.039200 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 6)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 14.346500 ms (FindLiveObjects: 1.578700 ms CreateObjectMapping: 1.541400 ms MarkObjects: 11.190500 ms DeleteObjects: 0.035500 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 6)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 15.462000 ms (FindLiveObjects: 1.245000 ms CreateObjectMapping: 1.706300 ms MarkObjects: 12.467100 ms DeleteObjects: 0.043200 ms)
Game mode: Hard
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' loaded
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
Deleting Sound object 'Sound child (UnityEngine.GameObject)' as it is not currently playing any sound.
-> AC debug logger
Scene 'Academy' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...
loading on
-> AC debug logger
This is the full Player log of when running Load Game command:
Mono path[0] = 'D:/POTD_Unity_03_01_21/Build/New folder (9)/Plot of the Druid_Data/Managed'
/POTD_Unity_03_01_21/Build/New folder (9)/Plot of the Druid_Data/UnitySubsystems
Mono config path = 'D:/POTD_Unity_03_01_21/Build/New folder (9)/MonoBleedingEdge/etc'
Initialize engine version: 2021.3.0f1 (6eacc8284459)
[Subsystems] Discovering subsystems at path
GfxDevice: creating device client; threaded=1; jobified=0
Direct3D:
Version: Direct3D 11.0 [level 11.1]
Renderer: AMD Radeon R9 200 Series (ID=0x6810)
Vendor: ATI
VRAM: 2027 MB
Driver: 27.20.21003.1028
Begin MonoManager ReloadAssembly
Initializing input.
Input initialized.
D3D11 device created for Microsoft Media Foundation video decoding.
Initialized touch support.
UnloadTime: 0.580200 ms
Loading: Start
Unloading 5 Unused Serialized files (Serialized files now loaded: 6)
UnloadTime: 3.920700 ms
PlayerPrefs Key 'AC_PlotOfTheDruid_0' loaded
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
PlayerPrefs Key 'AC_PlotOfTheDruid_0' saved
-> AC debug logger
A local EventSystem object was found in the scene. This will override the one created by AC, and may cause problems. A custom EventSystem prefab can be assigned in the Menu Manager.
-> AC debug logger
Spawned instance of Player 'Jase'.
-> AC debug logger
Game version: 4.4.0
-> AC debug logger
SpriteAtlasManager.atlasRequested wasn't listened to while SkunkFart requested.
Loading: End
Canvas group not initialize
Unloading 10 unused Assets to reduce memory usage. Loaded Objects now: 18276.
Total: 12.969000 ms (FindLiveObjects: 1.548700 ms CreateObjectMapping: 1.674800 ms MarkObjects: 9.684100 ms DeleteObjects: 0.061000 ms)
Unloading 3 Unused Serialized files (Serialized files now loaded: 6)
loading screen not initialize
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 12.569400 ms (FindLiveObjects: 1.452400 ms CreateObjectMapping: 1.423000 ms MarkObjects: 9.667700 ms DeleteObjects: 0.025900 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 6)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 10.641000 ms (FindLiveObjects: 1.218600 ms CreateObjectMapping: 1.240900 ms MarkObjects: 8.134800 ms DeleteObjects: 0.046200 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 6)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 10.059000 ms (FindLiveObjects: 1.157600 ms CreateObjectMapping: 1.207300 ms MarkObjects: 7.672800 ms DeleteObjects: 0.021000 ms)
Unloading 0 Unused Serialized files (Serialized files now loaded: 6)
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 18264.
Total: 10.290000 ms (FindLiveObjects: 0.962600 ms CreateObjectMapping: 1.186300 ms MarkObjects: 8.120200 ms DeleteObjects: 0.020700 ms)
No Canvas Group component attached to UI prefab LoadMainMenu - cannot perform fade transition
-> AC debug logger
File read: C:/Users/Yakir/AppData/LocalLow/Adventure4Life Studios/Plot of the Druid\PlotOfTheDruid_1.save
-> AC debug logger
Deleting Sound object 'Sound child (UnityEngine.GameObject)' as it is not currently playing any sound.
-> AC debug logger
Scene 'Academy' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
To add a scene to the build settings use the menu File->Build Settings...
loading on
-> AC debug logger
Is "Academy" your first loading scene in the build settings, or an Addressable scene?
Are you getting this issue in the Editor, after setting the Play Mode Script option in the Addressables window to rely on the assets from the build? If so, share the Console messages - they'll provide better debug info than the Player log.
'Academy' is an Addressable scene.
I changed Play Mode script to Simulate Groups and
run the game in the editor.
Console screenshot, Editor log and Player log attached (for Restart Game and Load Game)
I hope that's help.
https://drive.google.com/drive/folders/16n8lFzwrb9aFlLX4IXIGMYmSKUZkm8Fa?usp=sharing
Are you switching Settings Manager asset, or changing its values through script?
Open up AC's SceneChanger.cs script, and find the line (around 1026):
At the top of this function, paste the following:
Share the Console message in full when it shows "Load scene: Academy" as the issue occurs.
"Are you switching Settings Manager asset, or changing its values through script?"
No.
I added the script you mentioned,
**console2 **screenshot added to the link:
https://drive.google.com/drive/folders/16n8lFzwrb9aFlLX4IXIGMYmSKUZkm8Fa
ok I found block of code in comment in the file SceneInfo.cs script:
https://drive.google.com/file/d/1wkJNqZUie4JQmPwNqNwYjF0g_L4sMwV1/view?usp=sharing
after uncomment it it works
I need the full message, that appears when you select "Load scene: Academy" in the Console window. This will include the stacktrace that reveals how it is being called.
full message for RestartGame:
Load scene: Academy
UnityEngine.Debug:Log (object)
AC.SceneChanger:LoadLevelCo (string,bool,bool) (at Assets/AdventureCreator/Scripts/Game engine/SceneChanger.cs:1029)
AC.SceneChanger:LoadLevel (string,bool,bool,bool,bool) (at Assets/AdventureCreator/Scripts/Game engine/SceneChanger.cs:595)
AC.SceneChanger:ChangeScene (string,bool,bool,bool) (at Assets/AdventureCreator/Scripts/Game engine/SceneChanger.cs:300)
AC.KickStarter:RestartGame (bool,string) (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:1344)
AC.ActionEndGame:Run () (at Assets/AdventureCreator/Scripts/Actions/ActionEndGame.cs:61)
AC.ActionList/d__41:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:429)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd (AC.ActionEnd,int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
AC.ActionList:EndAction (AC.Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:530)
AC.ActionList/d__41:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd (AC.ActionEnd,int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
AC.ActionList:EndAction (AC.Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:530)
AC.ActionList/d__41:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.MonoBehaviour:StartCoroutine (System.Collections.IEnumerator)
AC.ActionList:ProcessAction (int) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:379)
AC.ActionList:ProcessActionEnd (AC.ActionEnd,int,bool) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:571)
AC.ActionList:EndAction (AC.Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:530)
AC.ActionList/d__41:MoveNext () (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:494)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Thanks.
Uncommenting the code block you found does seem to be the best way forward - let me know if you run into issues, though.