Page 1 of 1
Save quest state when switch to other scene?
Posted: Thu Nov 24, 2022 5:14 am
by namdang99
Is there any turtorial to save quest state when switch to other scene?
When my player move to other scene and then comback, the quest is reset.
Re: Save quest state when switch to other scene?
Posted: Thu Nov 24, 2022 8:17 am
by Tony Li
Hi,
Use the save system. See "Appendix 2: Save System" in the manual. Or use these steps:
1. Add these components to your Quest Machine GameObject: SaveSystem, JsonDataSerializer, PlayerPrefsSavedGameDataStorer.
2. Inspect your player's QuestJournal component. Tick Save Settings > Include In Saved Games, and set a unique key such as "playerJournal". (The key should be the same for the player's Quest Journal components in all scenes.)
3. Change scene using any of
these methods.
Re: Save quest state when switch to other scene?
Posted: Thu Nov 24, 2022 10:13 pm
by namdang99
Thank Tony!
I did it!
Now I want to save quest even if I quit play mode. How can I do?
Re: Save quest state when switch to other scene?
Posted: Fri Nov 25, 2022 9:11 am
by Tony Li
Hi,
If you want to save automatically when quitting play mode / exiting the game, add an AutoSaveLoad component to the GameObject, and tick Save On Quit. Leave the other checkboxes UNticked.