How do I make "Look At" work properly

Hey,

I am trying to use the “Look At” node to make my character look at the camera when my toggle is on.

When I toggle the Look At off and on for the head it works fine. The character’s head faces the camera like it should.

(See image below)

When I toggle the Look At off and on for the eyeballs, it also works fine. The character’s eyes point to the camera like they should.

(See image below)

However, when I toggle the Look At off and on for both the head and the eyeballs, the head looks at the camera like it should, but the eyeballs just point to the bottom right of the screen. In fact, if the head is pointing in any direction other than the default straightforward, the eyeballs will not look at the camera like I want them to. They will continue to point to the bottom screen right of his face.

(See image below. One head is tilted to show that the eyes always point to the lower screen right and not at the camera when the Look At for the eyeballs is toggled on)

This is my Character Blueprint Event Graph setup below:

(Ignore the Set Delta Seconds Node. That was for something else)

This is my Animation Blueprint Anim Graph setup with the Look At node selected showing the details I set on the right.

My goal is to make the Eyeballs focus on the camera no matter how the head is tilted and turned.

Any help is greatly appreciated.

Thank You!

Maybe it has something to do with the eyes being children to the head, so the head angle is added to the eyes angle. Of course eyes have to be children to the head for their position to be changed accordingly, so maybe you can adjust the angle of the eyes by the angle of the head.

Edit: What happens if the camera is to the right of this person? Where do eyes go then?

Hey Tuerer,

Thanks for your response.

I just tried putting the camera on the other side and the same thing happens.

(See pic below)

I also tried having the eyes look at a cube which I placed in a separate Actor Blueprint outside the main Character Blueprint and I got similar results. When he is facing forward he looks up at the cube high up in front of him like he is supposed to. However, when I turn his head, his eyes still look straight ahead and up as if the cube is high up in front of him.

(See pic below)

I even rigged the cube to make it move around the scene and I got similar results. The eyes were always off if the head wasn’t pointing straight forward.

The problem still persists. Any more suggestions would be greatly appreciated.

Thank you!

It would seem to me that the problem is in the conflict of local and world coordinates.

The eyes turn right relative to the head, and the head, when turning, turns eyes even further. What is being rotated first, the head or the eyes? What if you change that sequence vice verca?

Hey Tuerer,

In order for the “Layered Blend Per Bone” node to work correctly, as seen in my “Animation Blueprint Anim Graph” picture, the bone higher up in the hierarchy has to be plugged in as the “Base Pose”.

So I have to plug the head/neck bone into the “Base Pose” while the eyes which are lower in the hierarchy get plugged into the “Blend Pose”. I can’t switch them around and change the order.

And I did assume that it might be a local space / world space thing so I messed with those settings along with some others in the details panel of the “Look At” node. That didn’t help me either.

I figured it out! Or I figured out a workaround at least.

I subtracted the head’s rotation from the eyeball’s rotation and got the eyes to look where I wanted them to look.

I put a socket on the nose bone between the eyes then used the “Get Socket Rotation” node in the “Character Blueprint” on that socket.
(See picture below)

I did the math using blueprint nodes to get the difference between the initial socket rotation and the rotation after the head turns.
(See picture below)

Then I plugged the resulting rotation into the “Transform (Modify) Bone” node in the “Anim Graph” of the “Animation Blueprint”. This basically neutralizes the eye’s rotation so no matter how the head is rotated, the eyes will look straight ahead. Then I plugged the "Look At node into the back of the “Transform (Modify) Bone” node and it worked.

(See picture below)

1 Like