Re: Centralized save manager events
Posted: Thu Apr 25, 2024 9:55 am
Hi,
I recommend against that because it makes it hard for Quest Machine to retain some quest info across scene changes. And it's probably just skirting around the issue instead of addressing it. The issue is probably that you have assignments between GameObjects that exist only in a specific scene and GameObjects such as Quest Machine that survive scene changes. When you change scenes, these assignments will become invalid. For example, if you assign the Quest Machine GameObject's dialogue UI to a scene-specific player Quest Journal's Dialogue UI field, the Quest Journal's Dialogue UI assignment will be come invalid. You can either assign a quest dialogue UI that exists only in the same scene as the Quest Journal component and doesn't survive scene changes, or you can leave the Quest Journal component's Dialogue UI field unassigned in which case it will use the Quest Machine GameObject's dialogue UI by default without needing any assignment.
BTW, you can still have a Quest Machine GameObject in each scene. I recommend configuring a Quest Machine GameObject the way you want and then dragging it into the Project view to create a prefab variant. Then add instances of this prefab variant to whatever scenes you want. During play, when you change from one scene with a Quest Machine to another, the original Quest Machine GameObject will survive the scene change and replace the one in the new scene, allowing Quest Machine to retain information across scene changes.
I recommend against that because it makes it hard for Quest Machine to retain some quest info across scene changes. And it's probably just skirting around the issue instead of addressing it. The issue is probably that you have assignments between GameObjects that exist only in a specific scene and GameObjects such as Quest Machine that survive scene changes. When you change scenes, these assignments will become invalid. For example, if you assign the Quest Machine GameObject's dialogue UI to a scene-specific player Quest Journal's Dialogue UI field, the Quest Journal's Dialogue UI assignment will be come invalid. You can either assign a quest dialogue UI that exists only in the same scene as the Quest Journal component and doesn't survive scene changes, or you can leave the Quest Journal component's Dialogue UI field unassigned in which case it will use the Quest Machine GameObject's dialogue UI by default without needing any assignment.
BTW, you can still have a Quest Machine GameObject in each scene. I recommend configuring a Quest Machine GameObject the way you want and then dragging it into the Project view to create a prefab variant. Then add instances of this prefab variant to whatever scenes you want. During play, when you change from one scene with a Quest Machine to another, the original Quest Machine GameObject will survive the scene change and replace the one in the new scene, allowing Quest Machine to retain information across scene changes.