Loading...

Logo
DocumentationBehaviorsCustomModify Save File
Custom

Modify Save File

Last updated March 1, 2023

Description

Modify the contents of the project save file. You can use this to save progress that persists after the player leaves and comes back.

Properties

Triggers Immediately

Modification

Select the modification you would like to apply to the save file.

  • Set Key: Set a key with its associated value to file to be used later. It is retrieved back again using the Load from File behavior. If the key already exists in the save file, it will be overwritten.
  • Delete Key: Deletes an existing key in the save file so it can be forgotten.
  • Delete All Keys: Removes all key values from the save file. This is equivalent to resetting the save file.
Key Type

When setting or deleting a key, you can choose to use an existing key or a dynamic key. Both key types work the same functionality-wise.

  • Existing Key: Select an existing key to use. To create a key, press the plus icon.
  • Dynamic Key: Enter the name of the key you wish to use, or plug an output field to dynamically reference a key.
Force Save

By default, this toggle is off. If enabled, the project will forcefully save changes immediately. If disabled, changes are only saved when quitting the project or switching scenes - this means that if the project crashes or the app unexpectedly quits, changes are lost.

Outputs

This behavior has no outputs.

Example

You can use this behavior to save any value you want. For example, you can store the player's highest score by setting the modification type to be Set Key and plugging the score value in. To delete the high score, simply delete the key associated with the value using the Delete Key modification type.

Load from File