AI Command Lab // Flight Simulator
204D: The IK Link
Initial AI Output (Fragile)
// AI-Generated Code: Static Positioning
// Audit Fail: Hoping the animation lines up with the object.
// If the gun model changes size, the hands will float in air.
animator.Play("HoldGun");
Initial AI Prompt
"You ask the AI: "Make the character hold the gun.""
Pilot Comm Link
Mission Objective: A skilled Pilot directs the AI to use OnAnimatorIK. You command: "Set the IKPositionWeight and IKPosition of the Right Hand to match the Gun Handle transform."
Optimized Protocol
// Corrected: Physical Grip
void OnAnimatorIK() {
animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1f);
animator.SetIKPosition(AvatarIKGoal.RightHand, gunHandle.position);
}