Description
NetworkAnimator.ParseStateMachineStates() logs Debug.LogError for conditional transitions that target the Exit node of a sub-state machine. These transitions are valid Mecanim configurations — the actual destination is resolved by the parent state machine's StateMachineTransitions — but NetworkAnimator only checks transition.destinationState and transition.destinationStateMachine, both of which are null for Exit transitions.
The error message is:
[<GameObject>][Conditional Transition for <StateName>] Conditional triggered transition has neither a DestinationState nor a DestinationStateMachine! This transition is not likely to synchronize properly.
This is a false positive. The transitions work correctly in Mecanim; the issue is that ParseStateMachineStates does not account for transition.isExit == true when conditions are present.
Additionally, because these transitions are skipped (not added to TransitionStateInfoList), they are also missing from the m_DestinationStateToTransitioninfo lookup table used at runtime for synchronizing late-joining clients. This could mean trigger-based transitions routed through a sub-state machine Exit node may not synchronize properly in multiplayer.
Reproduce Steps
- Create an Animator Controller with a sub-state machine (e.g. "Sub SM")
- Inside the sub-state machine, add a state (e.g. "State A")
- Create a Trigger parameter (e.g.
MyTrigger)
- Add a conditional transition from "State A" to the Exit node using
MyTrigger as condition
- In the parent state machine, configure
StateMachineTransitions on the sub-state machine node to route to a parent state (e.g. MyTrigger → "State B")
- Add a
NetworkAnimator component referencing this Animator Controller
- Observe
Debug.LogError in the Console on every OnValidate (domain reload, component selection, scene save, etc.)
Actual Outcome
Debug.LogError is logged for each trigger condition on each conditional Exit transition:
[<GameObject>][Conditional Transition for State A] Conditional triggered transition has neither a DestinationState nor a DestinationStateMachine! This transition is not likely to synchronize properly. Please file a GitHub issue about this error with details about your Animator's setup.
These transitions are also not added to TransitionStateInfoList, so they are missing from the runtime synchronization lookup table.
Expected Outcome
ParseStateMachineStates should check transition.isExit before logging an error. Exit transitions with conditions are valid — the destination is resolved by the parent state machine's StateMachineTransitions.
- Ideally, the transition info should still be tracked (with the resolved destination from the parent's
StateMachineTransitions) so that trigger-based synchronization works correctly through sub-state machine Exit nodes.
- At minimum, no false
LogError should be emitted for valid Animator configurations.
Screenshots
N/A — the issue is in code logic, not visual.
Environment
- OS: Windows 11 Pro (10.0.26200)
- Unity Version: 6000.2.6f2
- Netcode Version: 2.7.0
- Netcode Commit: N/A
- Netcode Topology: Client-Server
Additional Context
The relevant code is in NetworkAnimator.cs, inside the #if UNITY_EDITOR block:
// Line ~250: Exit transitions WITHOUT conditions are correctly skipped
if (transition.conditions.Length == 0 && transition.isExit)
{
// We don't need to worry about exit transitions with no conditions
continue;
}
// Line ~270-296: But exit transitions WITH conditions fall through to the error
switch (parameter.type)
{
case AnimatorControllerParameterType.Trigger:
{
if (transition.destinationStateMachine != null)
{
// Recurses into destination sub-state machine
ParseStateMachineStates(...);
}
else if (transition.destinationState != null)
{
// Adds transition info to TransitionStateInfoList
}
else
{
// This fires for valid Exit transitions with trigger conditions
Debug.LogError($"[{name}][Conditional Transition for {animatorState.name}] ...");
}
break;
}
}
Suggested fix: Add an isExit check before the error branch, analogous to how destinationStateMachine is handled — resolving the actual destination via the parent state machine's StateMachineTransitions:
else if (transition.isExit)
{
// Transition targets Exit node — resolve actual destination
// from parent StateMachine's StateMachineTransitions table
// and add resolved transition info to TransitionStateInfoList.
}
else
{
Debug.LogError(...);
}
The unconditional Exit transitions (with HasExitTime and no conditions) are already handled correctly at line ~250 with a continue. The gap is specifically for Exit transitions that have trigger conditions (used for interrupting sub-state machine flows like attack combos).
Description
NetworkAnimator.ParseStateMachineStates()logsDebug.LogErrorfor conditional transitions that target the Exit node of a sub-state machine. These transitions are valid Mecanim configurations — the actual destination is resolved by the parent state machine'sStateMachineTransitions— butNetworkAnimatoronly checkstransition.destinationStateandtransition.destinationStateMachine, both of which arenullfor Exit transitions.The error message is:
This is a false positive. The transitions work correctly in Mecanim; the issue is that
ParseStateMachineStatesdoes not account fortransition.isExit == truewhen conditions are present.Additionally, because these transitions are skipped (not added to
TransitionStateInfoList), they are also missing from them_DestinationStateToTransitioninfolookup table used at runtime for synchronizing late-joining clients. This could mean trigger-based transitions routed through a sub-state machine Exit node may not synchronize properly in multiplayer.Reproduce Steps
MyTrigger)MyTriggeras conditionStateMachineTransitionson the sub-state machine node to route to a parent state (e.g.MyTrigger→ "State B")NetworkAnimatorcomponent referencing this Animator ControllerDebug.LogErrorin the Console on everyOnValidate(domain reload, component selection, scene save, etc.)Actual Outcome
Debug.LogErroris logged for each trigger condition on each conditional Exit transition:These transitions are also not added to
TransitionStateInfoList, so they are missing from the runtime synchronization lookup table.Expected Outcome
ParseStateMachineStatesshould checktransition.isExitbefore logging an error. Exit transitions with conditions are valid — the destination is resolved by the parent state machine'sStateMachineTransitions.StateMachineTransitions) so that trigger-based synchronization works correctly through sub-state machine Exit nodes.LogErrorshould be emitted for valid Animator configurations.Screenshots
N/A — the issue is in code logic, not visual.
Environment
Additional Context
The relevant code is in
NetworkAnimator.cs, inside the#if UNITY_EDITORblock:Suggested fix: Add an
isExitcheck before the error branch, analogous to howdestinationStateMachineis handled — resolving the actual destination via the parent state machine'sStateMachineTransitions:The unconditional Exit transitions (with
HasExitTimeand no conditions) are already handled correctly at line ~250 with acontinue. The gap is specifically for Exit transitions that have trigger conditions (used for interrupting sub-state machine flows like attack combos).