Hi,
I have an UI canvas in my first scene and set it as DontDestoryOnLoad,it has several layers and many child objects, and I add an active saver component to it. During the game, some of its child objects will become active, but here comes the save problem.
I use On Conversation End trigger to activate those child objects, their active state can be saved when I change sences, S/L, back to main menu(only in play mode).but when I back to edit mode and play the game again, I found their active state can not be saved when I load the game. Could you please tell me which step I did wrong, or I missed something? Thank you!
Question about active saver
Re: Question about active saver
Hi,
ActiveSaver and MultiActiveSaver components must be on GameObjects that are active when the scene starts. Is your ActiveSaver component on a GameObject that is active when the scene starts?
When you enter play mode a second time, are you loading a saved game? The save system will not automatically restore your last saved game. You can use an AutoSaveLoad component to do this, or you can load a saved game manually using the C# method SaveSystem.LoadFromSlot(#) or SaveSystemMethods component.
ActiveSaver and MultiActiveSaver components must be on GameObjects that are active when the scene starts. Is your ActiveSaver component on a GameObject that is active when the scene starts?
When you enter play mode a second time, are you loading a saved game? The save system will not automatically restore your last saved game. You can use an AutoSaveLoad component to do this, or you can load a saved game manually using the C# method SaveSystem.LoadFromSlot(#) or SaveSystemMethods component.
-
- Posts: 23
- Joined: Wed Dec 13, 2023 9:23 am
Re: Question about active saver
Hi,
Yes, the father object is active when the scene starts.ActiveSaver and MultiActiveSaver components must be on GameObjects that are active when the scene starts. Is your ActiveSaver component on a GameObject that is active when the scene starts?
I think I loaded a saved game, I'm using the Dialogue System Menu Framework. Here are my menu system and dialogue system, I don't know if I did something wrong, thank you!When you enter play mode a second time, are you loading a saved game? The save system will not automatically restore your last saved game. You can use an AutoSaveLoad component to do this, or you can load a saved game manually using the C# method SaveSystem.LoadFromSlot(#) or SaveSystemMethods component.
- Attachments
-
- 2.png (27.81 KiB) Viewed 113 times
-
- 1.png (27.18 KiB) Viewed 113 times
Re: Question about active saver
How are you changing scenes? Please see How To: Change Scenes With Save System. See also: How To: Manage Player Controls and Scene Changes.
When you're in the main menu scene, are you using the "Load Game" or "Continue" buttons to load a saved game?
When you're in the main menu scene, are you using the "Load Game" or "Continue" buttons to load a saved game?
-
- Posts: 23
- Joined: Wed Dec 13, 2023 9:23 am
Re: Question about active saver
Hi,
I've tried to watch a regular GameObject's active state in another scene, and it can saved perfectly. So I think maybe the UI canvas itself has the problem. Here's my custom persistent singleton script, I'm not sure if it is correct and related to this problem.
And actually, the UI canvas is using this Dynamic Panel, https://github.com/yasirkula/UnityDynam ... me-ov-file, so I'm not sure if I should customize that Dynamic Panels Canvas script, or I should write a custom saver? Thank you!
I use PixelCrushers.SaveSystem.LoadScene("sceneName").How are you changing scenes?
Yes, I use LoadGamePanel.LoadCurrentSlot() and SaveHelper.LoadLastSavedGame.When you're in the main menu scene, are you using the "Load Game" or "Continue" buttons to load a saved game?
I've tried to watch a regular GameObject's active state in another scene, and it can saved perfectly. So I think maybe the UI canvas itself has the problem. Here's my custom persistent singleton script, I'm not sure if it is correct and related to this problem.
Code: Select all
using UnityEngine;
public class DontDestroy : MonoBehaviour
{
private static DontDestroy instance;
private void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(gameObject);
}
}
}
Re: Question about active saver
Hi,
Is it possible that the ActiveSaver or some other component is losing its reference to the Don't Destroy On Load GameObject? Please see the How To: Manage Player Controls and Scene Changes link above for an explanation of how this can happen and how to address it.
Is it possible that the ActiveSaver or some other component is losing its reference to the Don't Destroy On Load GameObject? Please see the How To: Manage Player Controls and Scene Changes link above for an explanation of how this can happen and how to address it.