Forum rules - please read before posting.

Saving autosave before changing scene issues

I wish to implement the autosave feature in a way that it automatically saves the game right before we change the scene.
For that I used the OnBeforeSceneChange event.
The problem I am facing is that whenever I load an autosave saved with this event, the camera reverts to MainCamera(so not a game camera) and the player position does not seem to be saved, the player get's positioned to (0,0,0).
I did try both SaveSystem.SaveAutoSave(); and an ActionListAsset to save the game, both with the same result.
I assume this event is not adequate for this case?

Comments

  • Saving should not be performed while changing scene. You should instead save when the new scene has finished loading.

  • I wanted to auto save before scene change so I could abuse it for something else: Jumping to the map scene via UI button needs to save player position and camera in case the player wishes to exit the map and return to previous location.
    Closing it via button should return the player to the same location when he opened the map.
    This was the sole reason I wanted to save before switching scene, but I could probably do this in some other way.

  • You can rely on a separate Player character just for the map screen - see the Manual's "Player switching" chapter.

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.