Forum rules - please read before posting.

Help with Scene Management

Hi everyone!

I’ve only recently started using Adventure Creator, and I could use some help with scene management.

In my previous Unity project, a narrative walking simulator, the game was set entirely in a single location. I created an Environment scene and separate additive scenes for each chapter. Each chapter scene contained its own characters, the player, and the interactions specific to that chapter.

The Environment scene was set as the active scene, but changing the active scene to one of the additive scenes didn’t seem to make much difference, except that the ambient background audio would stop playing.

For my new project, I’m trying to implement a similar setup, but I’m having trouble getting it to work with Adventure Creator. It seems that AC requires the main scene to be the one I would normally load additively, which is causing some issues when switching scenes.

Currently, I have three scenes:

  • The main menu scene.
  • The Environment scene, which is already loaded and needs to remain loaded throughout the transition.
  • The gameplay scene that should be loaded when the player clicks the Start button in the main menu.
  • My goal is to:

  • Load the gameplay scene and make it the active scene.

  • Unload the main menu scene.
  • Keep the Environment scene loaded exactly as it is, without unloading or reloading it.

In the main menu scene, I’ve tried using the Scene: Switch action, but it also unloads the Environment scene.

When I use Scene: Add or remove to load the gameplay scene and unload the main menu, the Environment scene becomes the active scene instead.

What’s the correct way to set this up in Adventure Creator? Is there a way to make the newly loaded gameplay scene the active scene while keeping the Environment scene loaded and untouched?

Or would it be better to rethink my scene management approach entirely?

Thanks in advance for any help!

Comments

  • Welcome to the community, @DrLuccus.

    AC requires that it be run from your main/active scene, but the same is not true for the logic, ActionLists etc that they run.

    AC should also react to your active scene being changed as the result of how Unity updates it when a scene is closed. That is, if the main menu scene is the main scene, and the next listed in the Hierarchy is the Environment scene, then closing the main menu scene will make the Environment scene the main/active scene, and AC will react. This should also be the case if the active scene is changed through custom scripting (i.e. calling SetActiveScene)

    AC's GameEngine does not necessarily need to be present in a sub-scene for it to open, but it will need to be present if such a scene can become the main/active scene in this way.

    When sub-scenes are involved, however, changing active scene is best handled when you have a series of scenes that get opened/closed as the player progresses. For example, you start the game with Scenes A and B open, then A gets swapped with C as you enter B, etc.

    In this case, it might make things more manageable if you keep your active/main scene consistent throughout. If appropriate, this could be your Environment, or a separate Main scene that only has AC's core objects like the GameEngine and MainCamera. Each of the existing scenes you have now could then be added/removed as needed using the Scene: Add or remove Action.

    To clarify: the Scene: Switch Action will close all open scenes and load in the supplied one.

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.