Unity3D Eye Focus and Head Look


Unity 3d 2D Eye Focus and head look By XenoAisam

Hello guys! long time no see. This time I provide some useful tools that I made myself using unity scripting and it’s for Unity-er guys like me.

It’s useful stuff for the people who make anime model and use it in unity3d. It’s free.

Sorry, no new 3d model so far for now ๐Ÿ˜›

First Items:

2D Eyes Focus

2D eyes focus is suitable for the model which is using fully textured on eyes area. A bit of step to do start up but its less bug so far.


  • Unity 3D
  • 3D model which only use a texture for each eyes. Example: (Eye texture)


+Open your ready model and Export using FBX. :

+Import the model into Unity. Make sure the size in Unity is proper scale 1 , 1 , 1

+Import the custom package of “2D Eyes Focus’

+Add Xeno Eye Iris Focus Component on 3D model inspector

+Set ‘Head Model’ or any model which have Eyes Material on it

+For the “Eye Level” you need to create child GameObject on your model.

+Make sure the axis of Z (Blue) is aligned with your model facing.

+Now you can rename your ‘GameObject’ with ‘EyeLevel. And now make the head bone as its parent

+Now set the transform position of ‘Eye Level’ to all 0, 0, 0.
Probably you want to set your rotation to 80, 270, 0. But make sure your ‘Eye Level’ z-axis is facing same direction with your model face.

+Now you can drag the ‘Eye level’ into the empty slot of Eye level in 2d eye focus inspector

+’Target’ Empty slot is the target for the iris to focus/tracking/follow around. It’s up to you what kind of target you want to use.
If you want to use script and change the target in real-time, use this method to call:
var NewTarget : Transform;
var EyeFocusScript : XenoEyeIrisFocus;

function NewTargetting(){
EyeFocusScript.Target = NewTarget;

+Eye Setting drop down to setting the eyes. It’s all explanatory in the inspector

Have a nice trying ๐Ÿ™‚

Head Look


This is simple head look script that orientate the head to face the target position.
Not as powerful as the one in Unity example demo head look, but this one is easy to modify.
It’s also self explanatory and you can try ahead yourself ๐Ÿ™‚




  1. Awesome dude! Is it like mecanim SetTarget ? I use Mecanim SetTarget, but it never works. ๐Ÿ˜€

    I thought I’m going to try your eye movement tricks but sadly my model’s eye was controlled by Blendshape.

    Anyway, I really like your hair physics, unlike mine, moving crazily crashing through their heads. Unity’s rigidbody is pathetic, I hope Unity will support Bullet Physics soon.

    • Lol my hair physics not work well too. But physx engine is awkward compare with havok or bullet. Because when the model is small, the physic not behave properly. My model hair only use rigidbody, no collider apply. I just limit the rotation.

      About the eyes, I try to make it like hl2 source engine where the eyeball not move, only the texture of iris move. It is good for anime model which only use fully texture for eyes. So you need to change your method of modeling XD

      The head look is use for none mecanim character. So legacy animation user such me, this is good stuff ๐Ÿ™‚

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s