Hello. I'm stuck now about saving Variables. I know using Remember Variables for saving variables so I added it to the sprite component, but I don't know what should I do next.
First, the component variables of Variables (Script) is empty, even though I've already created 1 Integer variable and 2 Boolean variables in Variable manager under AC game editor.
Next, I created the Variables in Scene manager under AC game editor and I added 1 Integer variable to it, but still empty, I completely don't know what should I do for saving those variables.
Unity version: 2019.1.14f1
AC version: 1.69.2
Thanks!!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Both Local and Global Variables are saved automatically. Component Variables require the Remember Variable script.
The component variable is it's own thing, separate from Global and Local in the Game Editor Tab.
Yes, Global, Local and Component are all different places to define variables.
From the Manual's "Variables overview" chapter:
As you've already defined the Variable in the Variables Manager, it'll either be a Global or Local (depending on which tab you had selected at the time). This will be saved automatically. In order to change or read its value at runtime, use the Variable: Check and Variable: Set Actions respectively, setting the Source field to where you defined it.
Hello, Deckard_89 and Chris! Thanks for the comments.
I didn't know about those are saved automatically... I saw trough the manual and relative posts here though, probably I overlooked it.
Actually, I was thinking more difficult too much. I added Constant ID and Remember Transform to each hotspots, then finally it completely worked! (Or, I should add only Remember Transform in this case.)
I don't know why it didn't be saved. In my opinion, one of the reasons was that I chose Remove as a method to disappear items from the play screen. Originally, I should have chosen "Teleport" like the 2D tutorial, but I was choosing Remove.
In a nutshell, I was completely misunderstanding and I didn't know how different Variables and Remember components.
Thanks to Deckard_89 and Chris.