-
Notifications
You must be signed in to change notification settings - Fork 25
Using Aim IK in Unity 3D | version 2.x
Ehsan edited this page Aug 14, 2022
·
1 revision
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
orAim-IK Unity Package
file.- If you download the
Aim-IK.dll
file, you should make a folder in your UnityAssets
folder with the namePlugin
. Then putAim-IK.dll
file to it. - But if you downloaded
Aim-IK.unitypackage
file, go to Unity. In theAssets
folder, press right-click and then click onImport package > Custom Package...
. Then chooseAim-IK.unitypackage
and click onImport
button.
- If you download the
- Now, Aim-IK is ready to use!
- Select your model.
- Press
Add Component
. FollowScripts > 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 inSmooth Time
property (The standard value ofSmooth 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
andMax
variables, you can use theHead Limit Rotation
option (NOTE: If you want to limit the rotation, enableActive
check-box).
- In the
- 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
andLimit 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 twoMin
andMax
variables.
-
NOTE: Each chest part, has
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 addedAim IK Behaviour
previously. - Click on
Add Component
. FollowScripts > Head Gizmos
. - Now, the
Head Gizmos
added successfully!-
NOTE: You can't add
Head Gizmos
without addingAim IK Behaviour
.
-
NOTE: You can't add
- 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.
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 addedAim IK Behaviour
previously. - Click on
Add Component
. FollowScripts > Part Gizmos
.-
NOTE: You can't add
Part Gizmos
without addingAim IK Behaviour
.
-
NOTE: You can't add
- 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
ofAim 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.