Hi everyone, I found a bug with Adventure Creator’s Remember components when they are attached to objects that are children of the Player.
For example, I have a game object with mesh renderer attached to the Player, it has a Constant ID, and it has Remember Visibility enabled with “Visibility on start” set to OFF. At the start of the scene the object is correctly OFF, then during gameplay I turn it ON. However, when I switch to another scene, the object becomes OFF again and it does not remember that it was turned ON. This issue happens specifically when the Remember component is on a Player child object.
I also tested Remember Animator and Remember Material and they behave differently from Remember Visibility. When switching scenes, they seem to persist correctly, but they do not work properly with Save/Load. If I change the Animator state or Material during gameplay, then save the game, then make more changes, and then load the game, it does not restore the exact animation/material state that the object was in at the moment of saving.
I’m using Unity 6000.0.27f1
Adventure Creator 1.84.3.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Child Remember data on Player prefabs should be included in save-data.
Is your Player spawned in at runtime, with each of the Remember components having "Retain in prefab?" checked? The Console should report issues upon saving.
At first I did not have them Retain in prefab and console error showing "Could not save GameObject Cube because 'Retain in prefab?' is not checked!"
So I checked it but still the issue remains.
I tested it again on a new project with the latest AC version and LTS Unity version 6000.3 using AC Sample character and the issue is still there as well (Also no console errors showing)
I'll attempt a recreation, thanks for the report.
I have recreated the issue of the "Visibility on start" state being re-applied after a scene-change, but not that of Remember components in general not being saved/loaded when attached to a Player prefab.
What was the exact test you made with the AC Sample character?
If you save the game, manually enabled/disable the Renderer that the Remember Visibility affects, and then load the save, does its earlier state get restored?
For Remember Material, are you setting up the asset reference to be saveable, such that it works if not attached to a Player prefab? By this, I'm referring to the details in the Manual's "Saving asset references" chapter.
Hi Chris, thanks for checking this.
Just to update you: after updating to the newest Adventure Creator version, I can no longer reproduce the issue where Remember components in general (Animator / Material) fail to save/load when attached to a Player child object.
This issue was happening for me in the previous AC version, but now it seems fixed on my side (which is great).
However, the Remember Visibility issue still remains: if “Visibility on start” is set to OFF, and I enable the Renderer during gameplay, after switching scenes it gets turned OFF again because the initial “Visibility on start” state seems to be reapplied.
So currently the only issue I can consistently reproduce is the Remember Visibility behaviour after a scene-change.
Good. Yes, I've recreated that - a fix will be included in the next update.