NetworkAnimator: Conditional triggered transitions to Exit node log false errors
@NoelStephensUnity ya está trabajando en esto.
Desde el 23/3/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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
MyTriggeras condition - In the parent state machine, configure
StateMachineTransitionson the sub-state machine node to route to a parent state (e.g.MyTrigger→ "State B") - Add a
NetworkAnimatorcomponent referencing this Animator Controller - Observe
Debug.LogErrorin the Console on everyOnValidate(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
ParseStateMachineStatesshould checktransition.isExitbefore logging an error. Exit transitions with conditions are valid — the destination is resolved by the parent state machine'sStateMachineTransitions.- 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
LogErrorshould 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).
- Lenguaje dominante
- C#
- Estrellas
- 2.3k
- Forks
- 461
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 20
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Unity-Technologies/com.unity.netcode.gameobjects
-
stat:awaiting-response stat:imported type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
Unity-Technologies/com.unity.netcode.gameobjects#4159 · 3 comentarios ·
-
stat:reply-needed type:support
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · 10 comentarios ·
-
Tracking type:feature-2.x
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 comentarios ·
-
Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpy AbiertoTracking type:feature
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 comentarios ·
-
stat:awaiting-response stat:imported type:bug
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
Unity-Technologies/com.unity.netcode.gameobjects#3802 · 2 comentarios ·
Todos los issues de Unity-Technologies/com.unity.netcode.gameobjects
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nightscout/nocturne#1425 ·
-
【Bug】dotnet版本多行输出解析不兼容(含AI解决办法) Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
RayWangQvQ/BiliBiliToolPro#1137 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100