AI Command Lab // Flight Simulator
204F: The Root Drive
Initial AI Output (Fragile)
// AI-Generated Code: Desync
void Update() {
// Audit Fail: Moving the transform manually while an animation plays.
transform.Translate(Vector3.forward * speed);
}
Initial AI Prompt
"You ask the AI: "Move the character forward.""
Pilot Comm Link
Mission Objective: A skilled Pilot directs the AI to couple Root Motion. You command: "Enable ApplyRootMotion and transfer the animation data to the Rigidbody or NavMeshAgent in OnAnimatorMove."
Optimized Protocol
// Corrected: Coupled Physics
void OnAnimatorMove() {
agent.velocity = animator.deltaPosition / Time.deltaTime;
}