IK Weapon System in Unity

Chad Gutterman
2 min readJan 27, 2024

--

objective: to demonstrate how to setup an IK weapon system with a gun in Unity.

As you can see the hands are attached to the gun and move accordingly.

First you need to download or have a model for rigging and a gun. Then download or have an idle animation for the player to have, holding the gun preferably.

Add a new IK folder in the hierarchy and fill it like above.

Add a two bone IK constraint component and fill the top and source objects like above. Preferably use the shoulder, arm, and hand as the root, mid, and tip. Then add a hand position script and attach it to the left and right hand.

This code is for the target position of the hands. The final step is to fix the hands manually in play mode and copy the settings of the transform for each hand.

--

--