Forum rules - please read before posting.

I have a problem with saving and automatically loading the game.

At first everything was going well to save and load automatically.

In the ''Stage1'' game scene, I placed an action on the menu button so that when the player wants to exit ''return to the title screen'' with the save action '' save overwrite existing save --> AutoSave '' making return the title scene, in the title scene in ''onLoad'' I put the save action ''save overwrite existing save --AutoSave '' to always update the save in which the title scene starts, because I want that when the load be done is started on the title screen and not on the ''Stage1'' scene and to automatically load I put a ''load Game -->AutoSave' action in the ''actionlist Asset'' that is triggered through ''onStart' ' right when the player enters the game.

I put some keying variables to avoid conflict between saving and loading.

At first everything was working correctly that way. But without me having made changes after a while the game always loads in Stage 1, I already delete the Gi cache, ''clear all PlayersPrefs'' and it's no use, I think it corrupted I don't know. Any solution?

Comments

  • By default, save-game data is stored in separate files on your system, rather than PlayerPrefs.

    You can get all information about what save-game files exist, where they are, and what data they contain via the "Manage save-game files" button near the top of the Settings Manager.

    In the "Player data" section of a save-file, the "Scene info" panel describes which scene the save was recorded in.

    If you want the loading of a save-file to bring up the title scene, however, you don't need to have recorded the save-file in that title scene. You can save the game as normal, and then use the Save: Save or load Action's Selective loading? option to prevent the loading of the correct scene by unchecking Load scene?.

  • worked, thank you

  • edited July 2023

    I have a strange problem that occurs when the game loads right at the beginning, two ''ui unity in scene'' buttons that change menus simply do not work, it is as if they were stuck, other buttons on the same screen that are not switching menus work normally. This bug only occurs if the game has not yet been saved in the other scene, when I save in the other scene and I exit the game and enter the game with the load occurring, the bug disappears.

    I verified that disconnecting the action ''save load game --> unchecked load scene? .'' the bug also disappears. Looks like something to do with loading.

  • Is the use of "Unity Ui In Scene" necessary for the Menu? This is typically only needed if you have a Menu that appears in World Space, i.e. in a specific position in 3D space.

    If possible, switch over to "Unity Ui Prefab" so that there's no connection between the Menu and the scene. If you need to hide it in other scenes, you can lock it with the Menu: Change state Action.

  • I made the change to Prefab, it only worked in test mode on unity, when I installed it on my cell phone the problem persists. The bug only disappears on the cell phone when I leave the ''title menu'' scene and enter ''Stage 1'' and return to the ''Title menu'' scene and whenever I return to the menu scene, the game is saved. Once this is done, the buttons that trigger other menus work normally, even leaving the game and returning.

    Another way to not have this bug is to disconnect the function from load --> auto save --> load Scene ? Unchecked. The game load function is triggered by a call that I placed in onStart / OnLoad to access the actionList Asset that triggers the loading of the saved game.

  • When you say that the buttons do not work, do you mean that they don't run their "click behaviour", or are they completely non-interactable - i.e. not changing to their colour when tapped?

    What input system are you using, and are you making use of any custom Event System - either in the scene, or assigned in the Menu Manager?

    Does the issue occur if you temporarily switch the Menu's Source to Adventure Creator, so that Unity UI is no longer involved?

  • https://uploaddeimagens.com.br/imagens/Ke7wJqI

    They don't perform the click behavior, a coloration appears on the two buttons as if they were already clicked. It has several buttons, most of them are for buying credits and for viewing ADS advertising, all of these work normally, with the exception of two buttons that change menus, those that change menus that initially cause problems.

    The event System is a prefab that I put in the menu manager, the EventSystem of the scene was deleted.

  • However this warning appears;

    ''A local EventSystem object was found in the scene. This will override the one created by AC, and may cause problems. A custom EventSystem prefab can be assigned in the Menu Manager.''

    But the Event System is not in the scene, I think it is being called by some ADS script.

  • If the Menu is appearing and partially-interactive, try removing the link between the Buttons and AC's Menu Manager elements, and using their "On Click" events to run AC ActionList assets manually.

    An ActionList can be run by calling its "Interact" function.

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.