{"record":{"id":"23f7ff79455b4089","repo":"stride3d/stride","slug":"name","errorCode":null,"errorMessage":"name","messagePattern":"name","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Engine/Engine/AnimationComponent.cs","lineNumber":140,"sourceCode":"                BlendOperation = blend,\n                RepeatMode = repeatMode ?? clip.RepeatMode,\n            };\n\n            PlayingAnimations.Add(playingAnimation);\n\n            return playingAnimation;\n        }\n\n        /// <summary>\n        /// Crossfades to a new animation.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"fadeTimeSpan\">The fade time span.</param>\n        /// <exception cref=\"ArgumentException\">name</exception>\n        public PlayingAnimation Crossfade(string name, TimeSpan fadeTimeSpan)\n        {\n            if (!Animations.ContainsKey(name))\n                throw new ArgumentException(nameof(name));\n\n            // Fade all animations\n            foreach (var otherPlayingAnimation in PlayingAnimations)\n            {\n                otherPlayingAnimation.WeightTarget = 0.0f;\n                otherPlayingAnimation.CrossfadeRemainingTime = fadeTimeSpan;\n            }\n\n            // Blend to new animation\n            return Blend(name, 1.0f, fadeTimeSpan);\n        }\n\n        /// <summary>\n        /// Blends progressively a new animation.\n        /// </summary>\n        /// <param name=\"name\">The name.</param>\n        /// <param name=\"desiredWeight\">The desired weight.</param>\n        /// <param name=\"fadeTimeSpan\">The fade time span.</param>","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Engine/Engine/AnimationComponent.cs#L122-L158","documentation":"AnimationComponent.Crossfade throws ArgumentException when no animation with the given name exists in the Animations dictionary. The check `!Animations.ContainsKey(name)` guards against starting a fade to a clip that was never registered on this component, since a crossfade requires an existing playing-animation target. The exception message is just the parameter name, which is a known Stride quirk (it uses `nameof(name)` as the message).","triggerScenarios":"Calling Crossfade(\"Walk\", TimeSpan.FromSeconds(0.3)) when \"Walk\" was never added via Animations.Add, after the animation was removed, or when the name string differs in case/spelling from the registered key.","commonSituations":"Typos in animation clip names, renamed assets after code was written, loading animations asynchronously and crossfading before registration completes, or sharing animation code between entities that have different animation sets.","solutions":["Check Animations.ContainsKey(name) before calling Crossfade and handle the missing case explicitly.","Verify the animation was registered on the same AnimationComponent instance you are calling Crossfade on.","Log or enumerate Animations.Keys to confirm the exact registered name (watch casing)."],"exampleFix":"// before\nanimComponent.Crossfade(\"Walk\", TimeSpan.FromSeconds(0.3));\n// after\nif (animComponent.Animations.ContainsKey(\"Walk\"))\n    animComponent.Crossfade(\"Walk\", TimeSpan.FromSeconds(0.3));\nelse\n    Log.Warning($\"Animation 'Walk' not found. Available: {string.Join(\", \", animComponent.Animations.Keys)}\");","handlingStrategy":"validation","validationCode":"if (animComponent.Animations.ContainsKey(name))\n    animComponent.Crossfade(name, fade);\nelse\n    Log.Warning($\"Animation '{name}' not registered.\");","typeGuard":null,"tryCatchPattern":"try { animComponent.Crossfade(name, fade); }\ncatch (ArgumentException) { Log.Warning($\"Crossfade target '{name}' not found on AnimationComponent.\"); }","preventionTips":["Centralize animation names in string constants shared with asset setup.","Validate all clip names at scene load time, not at gameplay time.","Watch for casing differences between asset names and code strings."],"tags":["animation","argument-validation","csharp"],"backgroundTag":"invalid-argument-value","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}