On this page
Aim Idle: an independent crossbow IK comparison
Open Scenes/AimIdle.unity after importing Demos and applying Tools > ECSAnimator > Demos > Use URP Preview or Use HDRP Preview, matching your project. This optional scene belongs to theme 14; it does not replace Scenes/14_TwoBoneIK.unity or alter the existing Idle/Shoot animations and Attack-state demo.
Both characters continuously play the new Crossbow_AimIdle clip: a four-second looping chest-level crossbow hold, facing forward, with subtle breathing and planted feet. Blue has no pose processor. Red adds two arm IK chains and left foregrip following. No Attack trigger or frozen animation frame is needed.
Controls
- Enable arm IK fades correction in or out. At zero weight, red returns to the same moving Aim Idle as blue.
- Auto target height sweeps vertically, including beyond the permitted pitch range. Disable it to use Target elevation, or move Aim Target in Scene view during Play.
- IK strength blends the authored pose and the corrected arms. Inspector Max Aim Angle defaults to +/-45 degrees; partial strength and clamping can visibly miss the target.
- Muzzle 3D error and grip show actual committed-pose measurements. The red ray starts at the central bolt rail and follows the real weapon direction; it is not drawn directly between muzzle and target to conceal error.
Pose and target flow
The authored launch rail faces character +Z: its XZ heading matches the character, with no authored horizontal aim offset. Runtime applies pitch about character X only; it does not calculate or compensate muzzle yaw. The target is converted from world space to character-root space. Height and forward distance, including the muzzle's positional offset from the shoulder pivot, determine pitch. This positional correction is still needed because the weapon is above and in front of the pivot. Sideways targets do not turn the character. IK changes the arms and weapon; body heading, waist and legs keep their authored motion. Baked Humanoid reconstruction and floating-point pose composition can retain a small numerical angular error; the demo reports the actual shot direction.
AimIdleDemo supplies independent root-space hand positions, rotations, elbow hints and weights. It reuses CrossbowPoseProcessor: solve the right arm, read its solved palm, transform the foregrip, then solve the left arm. Segment lengths remain fixed, and unreachable positions are clamped. The source pose is evaluated afresh each frame, so correction does not accumulate.
This page owns its clip, AimIdle.controller, source Prefab, conversion preset and prebuilt EntityDesc. The clip was authored separately using Unity skeletal posing and Humanoid curves; the existing Blender-made model and reference poses are reused without changing the original assets. Runtime does not need Blender or the editor authoring tools. Controller state: Base Layer/AimIdle#0; no parameters. Resource key: ECSAnimator/AimIdle/CrossbowGuard/CrossbowGuard_EntityDesc.
Enable Require Pose Processing during conversion and check prepared.SupportsPoseProcessing. Ordinary blue animation omits the callback. This remains the explicit LocalResolve pose API, not Unity Animator IK Pass, OnAnimatorIK, whole-body IK or terrain adaptation. For API ownership and restrictions see the main IK documentation.
