Hello, I am using Unity 2018.1.4f1 & AC1.67.2. When I am implementing the save game function, I encountered a few issues:
When the animation controller in a animator component is changed during the game, the Remember Animator component seems not saving the animator controller. Is it the way it suppose to be or am I doing it wrong? The animator controllers are already under a Resources folder.
In one case I am using Remember Transform with Save change in parent on a NPC. When the NPC hits the Player it will become a child of the Player for a few seconds.
The issues is, if I save game when the NPC is NOT the Player's child, and then load the save during the NPC being the Player's child, the NPC will have no parent (correct) but treated the local position under the Player before load game as its global position after load game.
How to handle changes in a scene when switching away from the scene? For example, if a conversation options are disabled or enabled, then the Player goes to another scene and come back later, how to keep the conversation option changes? Does it mean a save action is needed at every switch scene?
Thank you.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Sorry I forgot the 4th one in the last post:
The Player (or NPCs) will have its standard animations (walk, run, idle etc.) changed in some events, and I currently handle this by switching the Animator Controller in the Animator component . I hope such change can be saved.
It happens both with and without the ** Remember NPC** component.
Thanks I got the conversation part. But how about other objects like Hotspot and Triggers on & off status? And also the objects being added or removed in the scene?
What would the best practice to deal with these situations of retaining changes of objects across scenes?
Thanks, I just somehow missed this.
Thanks.
In this case I think it is a custom script attached to the NPC rather than a general issue. I will solve it inside the script.
Understood.
Regarding issue 1:
Thank you so much for adding the feature to save the Animator Controller in the Remember Animator component. In the manual it says the feature is an option. While I can see the new "Set default" check box, I cannot find the option to save the Animator Controller. Could you please advise how to use te new feature?
I am using AC1.68.3 and Unity 2018.1.4f1. Thanks
The saving of the "runtime animator controller" is automatic, there is no option for it. However, as with any other change in asset file you wish to save, it's name must be unique, and placed in a Resources folder - see the Manual's "Saving asset references" chapter for more.
Hi, I am facing the issue that the Remembe Animator works during scene change, but not load game. When changing the player's sprite child animator, it doesn't work when load game. I am sure it is inside a "Resources" folder directly under "Asset". The player is set to be initialized upon scene starts.
When I try to do a build, this error shows up:
https://imgur.com/a/IoKEM6c
I am using Unity 2018.1.4f1 and AC1.69.4
Just tried even putting the player into the scene to begin with doesn't help.
I tested that it works on objects animators, it works on NPCs, it just doesn't work on the player......
I think I observed wrong, actually it can remember the animator state, but not the animator controller.
I am trying this alternative by putting the animator controller path inside a component variable. but it seems cannot get the path in the variable or correctly read the string?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using AC;
public class CustomRememberAnimatorPath : MonoBehaviour {
The value is always empty after loading. I have the Remember Variable component attached.
The OnFinishSaving event will be called once the save file has been written to. Use OnBeforeSaving instead to have the change made to Variables be incorporated into the save.
Going back to the original issue, the build error looks related to your system/OS settings. See these related threads on the Unity forums:
https://answers.unity.com/questions/458449/moving-file-failed-error.html
https://answers.unity.com/questions/24571/moving-file-failed.html
https://answers.unity.com/questions/1218959/moving-file-failed-5.html
When I look into the AC RememberAnimator.cs, I see this line:
[SerializeField] private bool saveController = false;
and these under the SaveData() function:
if (saveController && _animator.runtimeAnimatorController != null)
{
animatorData.controllerID = AssetLoader.GetAssetInstanceID (_animator.runtimeAnimatorController);
}
Do these scripts cause the animator controller not being saved? Should I turn saveController = true?
I am using 1.69.4
If saveController is true, then the Animator's Animator Controller will be saved - provided that it has a unique name and is placed in a Resources folder.
That it is not exposed in the Inspector is a bug. I will address this for v1.70, but in the meantime you can insert the following into the bottom of the same script's ShowGUI function: