- Home /
Issue with a Mecanim motion reference in synchronized layers
I have a question regarding the API involving mechanic running in editor mode. When I run the following function on a regular layer / state machine using a valid blend tree or animation clip reference, the editor correctly has the motion reference set in the state.
However, nothing happens when this is called on a state machine whose layer is synchronized, it does nothing. And specifically, the destination state machine is the one marked for synchronize.
The editor still shows the motion references to be blank. If the layer is not synchronized, I have no API issues. Is there something special you have to do in order to set the references for a state's motion correctly during edit mode?
You can see in this screen shot that the motion reference is set to 'none'...
private static void AddStateToMachine( AnimatorController controller, AnimatorStateMachine machine,
string stateName, string speedParameter, Motion motion )
{
AnimatorState newState = machine.AddState (stateName);
newState.motion = motion;
if (speedParameter != null)
{
newState.speedParameter = speedParameter;
newState.speedParameterActive = true;
}
}
Your answer
Follow this Question
Related Questions
How to tell if an animation clip is playing in the editor(NOT in playmode) with an editor script 1 Answer
UnityEditor.Animations.AnimatorControllerLayer.SetOverrideMotion not working 0 Answers
Animation in edit mode with Mecanim 0 Answers
Animation preview not working for model with generic rig and root motion. Is this a bug? 2 Answers