NetworkAnimator: Conditional triggered transitions to Exit node log false errors
Mantenedores costumam responder em até 2 dias
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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).
- Linguagem predominante
- C#
- Estrelas
- 2.3k
- Forks
- 464
- Merge médio
- 4d 4h
- PRs com merge (30d)
- 18
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Unity-Technologies/com.unity.netcode.gameobjects
-
NetworkList changes made since the last tick are applied twice on a newly synchronized clientAbertastat:awaiting-triage stat:import stat:reply-needed type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4179 ·
Mantenedores costumam responder em até 2 dias
-
Tracking type:feature-2.x
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 comentários ·
Mantenedores costumam responder em até 2 dias
-
Tracking type:feature
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 comentários ·
Mantenedores costumam responder em até 2 dias
-
stat:awaiting-response stat:imported type:bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
Unity-Technologies/com.unity.netcode.gameobjects#3802 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
-
priority:medium stat:imported type:feature type:feature-2.x
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 42/100
Unity-Technologies/com.unity.netcode.gameobjects#3706 · 5 comentários ·
Mantenedores costumam responder em até 2 dias
Todas as issues de Unity-Technologies/com.unity.netcode.gameobjects
Issues semelhantes
-
[i18n] 安装实例完成后的成功提示未正确本地化Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
PCL-Community/PCL-CE#3658 ·
Mantenedores costumam responder em até 1 dia
-
Deploy & Patch-issues opprettes ikke: create-pnd-issues.yml har feilet hver uke siden 2025-09-08Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Altinn/altinn-auth#4359 ·
Mantenedores costumam responder em até 1 dia
-
type/automation type/tech-debt
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
High-DPI fixes for release/1.3: editor toolbar icons and Color Picker layout (patch included)Abertano-stack-trace
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia
-
S: Untriaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
project-wayfarer/wayfarer-14#1650 ·
Mantenedores costumam responder em até 2 dias