When I work on Save - Load and Optimisation stuff.
I discovered a problem. For example;
I have a Global Var in Type of Vector 3 named Hat Position. The
Default value is (0,0,0).
After set the Hat Position through an ActionList to (0,200,0) and saved game after action list is ended. The Hat position is save as (0,0,0). I examine this data through Settings -> Manage Save-Game Files.
I thought tha might be a problem with my managers. I switch them to default managers and then try to recreate
this problems again and the Hat Position is saved as (0,0,0) again .
And then I recreate a new Project and add AC to project. Then I create a new Game through game wizard. But the problem still the same. The Hat Position still saved as (0,0,0).
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I cannot recreate such an issue in the latest release. What is your AC version, and what platform are you building to?
Are you relying on any custom save method? Let's see screenshots of the Action and variable involved.
If you have Show realtime values? checked in the Variables Manager, and view the Variable's entry when you save, what value does it show?
The saving of variable data occurs in the SaveSystem script's CreateVariablesData function. Look for the "case VariableType.Vector3" statement: if you place a Debug.Log in there, it may help reveal the issue.
AC: 1.73.0
Unity: 2020.1.2f1
Build: PC
I'am not use any custom save methodes. Just use Variables -> Set : Global Variables
Using a backup/duplicate project, does this occur for you in the latest release?
Inside SaveSystem.cs, look for the following line inside its CreateVariablesData function:
Underneath, paste the following:
That should report the variable when saved in the Console - does it show, and what does it say?
But in Save-game Manager still show (0,0,0)
What was the result of testing the latest release, and what platform is active in your Build Settings?
Place another Log just above the last line of the same function:
What does that show, stacktrace included?
vector is (0,0,0) after save.


Prepare a test scene that contains a Variable: Set Action that sets the variable, and check that saving the game in that scene afterwards causes the issue.
Then, create a .unitypackage file of the scene, and your game's Managers. PM it to me, and I'll take a look.
Hi @ChrisIceBox!
I've been using your wonderful plugin for 2 years now and have been searching (and finding) informations on the forum. Your work is remarkable!
This is my first message here
I have the exact same issue than @FelixGumenita. I would like to know if you (both of you) find a solution?
Thx a lot
Welcome to the community, @Kinteros.
The specific case in this thread fixed after v1.74.5. IIRC at least part of the issue was related to the Save-game File Manager displaying incorrect values.
What are your AC/Unity versions and platform, and can you share some details about the issue, whether this affects all or only a specific variable, and what the save-data looks like in the Save-game File Manager?
Thx for your reply @ChrisIceBox
I will try to explain.
AC version : 1.80.5
Unity version : 2021.3.29f1
Some screens:


The variable:
The action before leaving the scene:

I'm leaving the scene to go to another scene.


The variable has been set to the correct value:
I save :

In the save file, the position is not recorded:

Save manager settings:

Am I doing something wrong?
Do global variables register correctly in the backup? Or do I need to do something special for Vector3?
Thank you very much
This is just a hunch, but what is your OS' system language, and does it use commas instead of decumals for numbers, i.e. 1,5 instead of 1.5? I wonder if this is down to the way variable values are being parsed into the serializer.
You have the eyes of a lynx! Good one! You're good!
Good guess, I'm French and I have WIN10 in french.
Is it possible to force localization in Unity? I'm looking in the preferences or project settings but I can't find anything about it
Looking around the forums, it's actually been a big problem for a lot of people since a 2018 version (it's global to Unity).
https://forum.unity.com/threads/decimal-separator-randomly-becoming-something-that-looks-like-a-comma.257708/
Do you force this type of format with CultureInfo? If that's already the case, there's something else that overrides it
Do you have any other ideas for solving this problem? I'm running out.
Thx
@ChrisIceBox nevermind, I pay more attention to forums and I've found a fix:
I added this script to my assets and it fixes the dot/comma bug.
Thank you so much for your very quick help !
I can't wait to show you the game we're making. By the way, how do you manage the rights to use your plugin and the games you create with it? I remember your old site had a section on this, but I can't find it on the new version.
Thanks a lot!
Script looks good, thanks for sharing.
So long as you don't use the demo assets for your game, you're free to distribute AC-built games as you wish.