Forum rules - please read before posting.

Problem switching Scenes

Hello,
I'm currently facing an unknown issue with my project

My game is a 2D point-and-click adventure, but without a physical player, and as such is without navigation as well.

As of now, I've got two scenes set up with AC, "Studio" and "A1". Whenever I test those scene by themselves, everything is working as expected (more or less). But whenever I try to switch between one scene and the other (either via Actionlist in scene or in an asset file), the scene changes but apparently AC doesn't work anymore. The cursor isn't shown, as well as the AC Debug window, nor do the hotspots or the interaction.

Any idea of why this is happening? The console isn't showing me anything. I also tried putting a comment in the OnSceneStart cutscene ActionList of scene A1, but apparently it doesn't get called.

Any help is greatly appreciated, thank you
Willy

Comments

  • Just to make sure. Have you added your scenes to the build? File>Build Settings..
    Please also include your AC and Unity versions in your posts.

  • yes, I've added them. I'm using unity 2020.2.0f and AC v 1.72.4

  • The cursor isn't shown, as well as the AC Debug window

    As in, the AC Debug window no longer shows?

    At the time that this occurs, do you have a GameEngine object in the new scene's Hierarchy, and a PersistentEngine object in your DontDestroyOnLoad scene's Hierarchy?

    The lack of a Player shouldn't affect anything, and AC should report in the Console if it's "gone to sleep". I can't immediately think as to why this might occur.

    What of your MainCamera? Is it attached to the scene's default GameCamera? (You can check at the bottom of the MainCamera Inspector at runtime)

    Are you making use of any custom scripts / third-party assets that may somehow be affecting things?

  • Hi Chris,
    yes, as in "the AC Debug Window no longer shows". As per your questions, I've noticed that my GameEngine GameObject isn't present whenever I switch scenes.

    I don't understand what do you mean with the question on the main Camera, so I've made a screenshot of both the Main Camera and the Nav Cam at runtime.

    https://imgur.com/a/VJan34f

    as per custom script and third party assets, I'm using Rewired with the integration script provided in your wiki, the quest system script also provided in your wiki, Inkle (with a Dialogue system made by me) and I think that's it.

    Willy

  • I've noticed that my GameEngine GameObject isn't present whenever I switch scenes.

    This is an object that should be part of the scene file, it's not spawned in at runtime. Are you saying it's being removed at runtime? It's showing in both of your screenshots.

    I'm assuming you're using the "Scene: Switch" Action to change scene. Though the other assets/scripts shouldn't be affecting things, duplicate your project and removing anything custom. Though things won't work as intended, you should still be able to test the scene-switching process.

    If you then have an AC-only project with two scenes that shows this issue, create a .unitypackage file of your scenes, Managers, and ActionList asset files, PM it to me and I'll take a look.

  • Ok, I might have found the problem: on the GameEngine gameobject I did add the ACQuestSystem script, which in its initialization is taken in the DontDestroyOnLoad. This was probably the reason why the GameEngine was being removed from my hierarchy. I've moved the quest system script in another gameobject and now the scene does have the AC Debug Window, although a different error is preventing the game from finishing the loading process. But from here I can work out the problem, thank you very much for your support!

    Willy

  • No problem.

    If you want to make use of custom scripts that should survive scene changes, you can either attach it to AC's PersistentEngine prefab, or attach it to a custom EventSystem prefab and asssign it in your Menu Manager (provided you make use of Unity UI for your Menus).

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.