Inverse Kinematics (IK) Setup for User Avatars in VR

Our video game development company runs independent projects, jointly creates games with the client and provides additional operational services. Expertise of our team allows us to cover all gaming platforms and develop an amazing product that matches the customer’s vision and players preferences.
Showing 1 of 1 servicesAll 242 services
Inverse Kinematics (IK) Setup for User Avatars in VR
Complex
~1-2 weeks
FAQ
Our competencies
What are the stages of Game Development?
Latest works
  • image_games_mortal_motors_495_0.webp
    Game development for Mortal Motors
    670
  • image_games_a_turnbased_strategy_game_set_in_a_fantasy_setting_with_fire_and_sword_603_0.webp
    A turn-based strategy game set in a fantasy setting, With Fire and Sword
    860
  • image_games_second_team_604_0.webp
    Game development for the company Second term
    490
  • image_games_phoenix_ii_606_0.webp
    3D animation - teaser for the game Phoenix 2.
    533

Setting up inverse kinematics (IK) for user avatars in VR

Task – take three data points (head, left hand, right hand) and from them create convincing body. This is Full Body IK for VR-avatar: three tracking points from headset and controllers must drive entire skeleton so avatar looks alive, not wooden mannequin with arms in right positions.

This is surprisingly non-trivial task.

Three data sources and what to do with them

From headset arrives: XRNode.Head (HMD position and rotation), XRNode.LeftHand, XRNode.RightHand. From head position and arm positions must recover pelvis position, spine, shoulders, elbows, legs.

Pelvis – approximated from head position with fixed offset downward. Problem: when player leans, this offset works incorrectly – pelvis "floats" forward unnaturally. Correct solution – smooth pelvis position relative to head movement history and use secondary heuristic: if head position height decreased by X cm – player crouched, shift pelvis down and forward.

Shoulders – recovered from head rotation and hand positions. If head turned right and right hand raised – right shoulder should rise, left fall. This realized through ChainIK or TwoBoneIK + MultiRotationConstraint in Unity Animation Rigging.

Elbows – most complex part. Two known points (shoulder and wrist) give infinite elbow solutions. Needed pole target: virtual point toward which elbow "pulls." Standard solution – pole target computed from horizontal projection of forearm with down-back bias. In XR Interaction Toolkit with Animation Rigging – TwoBoneIK Constraint with explicit Hint Target.

Implementation in Unity Animation Rigging

Package com.unity.animation.rigging version 1.1+ – standard for this task in Unity. Rig structure for VR-avatar:

  1. Rig Builder on character root
  2. Rig object with several Constraint components
  3. TwoBoneIK for each arm: Source – wrist bone, Target – VR controller transform, Hint – pole target
  4. MultiParentConstraint for neck/head: driven by HMD transform
  5. ChainIK for spine: from pelvis to chest, weight managed by torso tilt
  6. TwoBoneIK for legs (if foot IK needed on uneven surfaces)

Important nuance: rig weight system. Each Constraint has Weight from 0 to 1. During smooth transitions – for example, when player puts down weapon and enters locomotion – weights interpolated in code to avoid abrupt pose switch.

Problems encountered in production

Flickering at boundary poses. When player's arm goes behind back or raises above head, TwoBoneIK transitions to singular position – fully extended chain without unique solution. Avatar jerks. Solution – clamp extension angle: forbid TwoBoneIK fully extending (maximum angle 170° instead of 180°).

Hand desynchronization at high latency. If avatar renders in LateUpdate or with delay, arms lag real controllers. Avatar hands must update in OnBeforeRender or via XR Interaction Toolkit's late binding mechanism.

Calibration for player height. Head-to-pelvis offset not universal: 1.90m and 1.60m persons – different proportions. Proper implementation has calibration routine: player stands straight, presses button, system measures current HMD height and recalculates all offsets.

Timeline for setting up Full Body IK for VR-avatar: 3 to 7 business days depending on rig complexity and behavior requirements. Cost calculated individually.