public class AnimatorRootMotion : MonoBehaviour { Animator animator; void Start() { animator = GetComponentIn this example, the character's root motion is disabled when the "Attack" parameter is active, allowing for more precise control over the character's movement during combat. The "Walk" parameter is still applied normally, allowing the character to move around the game world. The Animator ApplyBuiltinRootMotion method is part of the UnityEngine.Animator namespace, which is included in the base Unity package.(); } void Update() { // Disable root motion for the "Attack" parameter animator.ApplyBuiltinRootMotion = !animator.GetBool("Attack"); // Play the appropriate animation based on the "Walk" parameter animator.SetBool("Walk", Input.GetKey(KeyCode.W)); } }