NetworkAnimator: Conditional triggered transitions to Exit node log false errors
@NoelStephensUnity đang làm issue này rồi.
Từ ngày 23/3/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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).
- Ngôn ngữ chính
- C#
- Star
- 2.3k
- Fork
- 461
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 20
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Unity-Technologies/com.unity.netcode.gameobjects
-
stat:awaiting-response stat:imported type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
Unity-Technologies/com.unity.netcode.gameobjects#4159 · 3 bình luận ·
-
stat:reply-needed type:support
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Unity-Technologies/com.unity.netcode.gameobjects#4095 · 10 bình luận ·
-
Tracking type:feature-2.x
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Unity-Technologies/com.unity.netcode.gameobjects#3870 · 5 bình luận ·
-
Please error, or at least warn, when a managed type is included in INetworkSerializeByMemcpy Đang mởTracking type:feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Unity-Technologies/com.unity.netcode.gameobjects#3830 · 7 bình luận ·
-
stat:awaiting-response stat:imported type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
Unity-Technologies/com.unity.netcode.gameobjects#3802 · 2 bình luận ·
Tất cả issue của Unity-Technologies/com.unity.netcode.gameobjects
Issue tương tự
-
[Feat] 조합 영역 구분선 개선 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
type/automation type/tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
t/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
ci-failure-cause test-failure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100