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)
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?
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.
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.
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?
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.