Forum rules - please read before posting.

Switch Scene and Reset Scene?

Hi!
In our game we have multiple minigames, which the player can start from a main menu scene, and the minigames can be replayed any number of times. These minigames are all in seperate scenes. So our challange is that we want to reset the minigame scene that the player played, so when they start it again, its completely reset.

It seems to work with thet Engine: End game, Reset Scene action, but it also reloads the scene. So If I check at the start of a minigame, if it needs to be reset, then reset it, it loads it again, even though the player already saw a loading screen. I havent tested in a build, but in Unity, I see the loading screen, then switch to black, then loading screen again.

I think the best solution would be to somehow to reset at the same time as switching the scene, but im not sure if thats possible with adventure creator? In the Scene Switch action I only see reload, and I guess that doesnt reset it. But maybe there is another solution? Thank you!

Comments

  • When calling the "Reset Scene", the open scene needs to be re-opened after having its cache data cleared - otherwise the effects of it won't be felt.

    However, it's possible to reset the scene / clear the cache data of an unopened scene through script, via either of the ClearLevelData functions:

    KickStarter.levelStorage.ClearLevelData ("MyMinigameScene");
    

    Calling this function through a custom script, before switching to it, will reset AC's data for it. To call this as part of an ActionList:

    1. Create a new C# script, and copy the above into a public function within it
    2. Attach the script to an empty GameObject, make a prefab and remove from the scene
    3. Use the Object: Call event Action to reference the prefab and call the function.
  • Thank you!!

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.