Forum rules - please read before posting.

Before Load Scene Reset Everything and Crash on Scene Changes

Hi,

I want to ask is there any way to reset scene before load it? I try to Reset The Game Function but its not work like I want.
I need to reset Scene Data before load it. On the other hand, I have an issue. In build when I want to load second time same scene the game stops working and crash if I clicking on screen.

Comments

  • The "Engine: End game" Action has a "Reset Scene" command, which will reset any save data associated with the scene, and then reload it.

    If that doesn't give you the behaviour you want, what is it you're looking to do?

    As for your crash, you'll need to share much more detail. What are your AC/Unity versions, build target, and is it always the same scene, or all scenes? What are the contents of those scenes, particularly in the way of Remember components?

  • edited February 2021

    AC 1.71.2 / Unity 2020.1.2f1

    For the reset and load scene, Before load specific scene I want to reset it. In the "Engine: End Game" the "Reset Scene" command does not allow me reset specific scene. On the other hand, I need to explain how I want to use save system.

    The game have a lot of scenes and in the every scene I take a auto save in the "OnStart" Action. The game does not allow player to take a save. When player want to continue from last save. There is a couple problem like some hotspots are not appiere or triggers are not working. Or, player position is wrong. I add remember components for each gameobject. Like on the player I have remember transform, remember visability ex. To avoid of these problems I want to reset everything in the scene before load it.

    For the crash. As I mention on the top I use 1.71.2 version of AC and 2020.1.2f1 version for Unity. Most of the time I use a lot remember component for the Triggers, Hotpots and for the actionlists. And when I try to load game tha aplication is stock and if I click on the screen the game is crash. It crash always in the same scene.

  • In the "Engine: End Game" the "Reset Scene" command does not allow me reset specific scene.

    If you want to clear the saved data for a specific scene, you can use the ClearLevelData function:

    AC.KickStarter.levelStorage.ClearLevelData (sceneIndex);
    

    There is a couple problem like some hotspots are not appiere or triggers are not working. Or, player position is wrong.

    It sounds like you're trying to overcome a more fundamental issue, rather than fixing it.

    Don't attach Remember Transform to your Player - AC will save the Player's position automatically, and this will create a conflict.

    I would need to know your specific issues in detail to provide more direction.

    It crash always in the same scene.

    It sounds like there's a specific GameObject (or perhaps more than one) that's causing the issue. Check Unity's crash log to see if it reveals any clues, otherwise it may have to be a case of disabling objects in your scene until the crash stops, and working out which object is the culprit through process of elimination.

  • Okay thank you Chris, I am upgrade AC right now. I will update the comment.

  • edited February 2021

    I found a solution.

    *You can Add an OnLoad Action List to every scene.
    *In the OnLoad Action list if you add Engine>End Game>Reset Scene Node the scene is restart from scratch.

    Everythink seems fine I am going to make some tests.

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.