Skip to content

Using Aim IK in Unity 3D | version 2.x

Ehsan edited this page Aug 14, 2022 · 1 revision

Aim-IK Wiki

How to use Aim-IK in Unity-3D?

Here are the following steps to using Aim-IK in Unity-3D:

  • At first, create a new project in Unity-3D.
  • Add your Rigged model.
  • Download Aim-IK DLL or Aim-IK Unity Package file.
    • If you download the Aim-IK.dll file, you should make a folder in your Unity Assets folder with the name Plugin. Then put Aim-IK.dll file to it.
    • But if you downloaded Aim-IK.unitypackage file, go to Unity. In the Assets folder, press right-click and then click on Import package > Custom Package.... Then choose Aim-IK.unitypackage and click on Import button.
  • Now, Aim-IK is ready to use!
  • Select your model.
  • Press Add Component. Follow Scripts > AimIK > Aim IK Behaviour.
  • In the Aim IK Behaviour script, you see some properties.
  • In the Target property, select the target object.
  • By enabling the Smooth Look At check-box, the character smooth looks at the target.
  • If you enable the Smooth Look At, you should set a value in Smooth Time property (The standard value of Smooth Time is between [0, 1]. By increasing it, the character looks at the target faster).
  • In the Head property, you see these options:
    • In the Part property, select the head rig (NOTE: Be aware to don't add head model! You must add head rig).
    • Another property is Position Offset. You can use it to set the eye position offset to the head character.
    • The next property is Rotation Offset. You can use it to set the rotation offset to the head.
    • So if you want to limit the head rotation in the z axis between two Min and Max variables, you can use the Head Limit Rotation option (NOTE: If you want to limit the rotation, enable Active check-box).
  • OK, now press Run and you see the head of the character, looks at the target. Cool!
  • And the last property is Chest Parts. It's an array that you can choose other chest parts that you want to look at the target.
    • NOTE: Each chest part, has Part, Position Offset, Rotation Offset and Limit Rotation (like the head).
    • In the Part property, select part rig (Be aware to don't add part model! You must add part rig!).
    • In the Position Offset property, set position offset to the part model.
    • In the Rotation Offset property, set rotation offset to the part model.
    • In the Limit Rotation property, limit the part rotation in 3 x, y and z axes between two Min and Max variables.

Using Head Gizmos

Head Gizmos using for draw eye line in the editor menu to show the aim direction.

  • For using Head Gizmos, select the model that you added Aim IK Behaviour previously.
  • Click on Add Component. Follow Scripts > Head Gizmos.
  • Now, the Head Gizmos added successfully!
    • NOTE: You can't add Head Gizmos without adding Aim IK Behaviour.
  • In this script, you see some properties.
  • If you enable Show Head Line, the eye line showing in the editor menu.
  • In the Head Line Color, you can set the eye line color.

Using Part Gizmos

Part Gizmos using for draw chest line in the editor menu to show the aim direction.

  • For using Part Gizmos, select the model that you added Aim IK Behaviour previously.
  • Click on Add Component. Follow Scripts > Part Gizmos.
    • NOTE: You can't add Part Gizmos without adding Aim IK Behaviour.
  • In this script, you see some properties.
  • In the Part, you need to add the part rig.
    • NOTE: Be aware to don't add part model! You must add part rig!
    • NOTE: You must select the part rig that exists in the Chest Parts of Aim IK Behaviour script.
  • If you enable Show Part Line, the chest part line showing in the editor menu.
  • In the Part Line Color, you can set the chest part line color.