x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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)

alt text

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)

alt text

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)

alt text

This is my Character Blueprint Event Graph setup below:

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

alt text

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

alt text

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!

Product Version: UE 4.21
Tags:
more ▼

asked Nov 28 '18 at 02:48 PM in Blueprint Scripting

avatar image

Zoinks360
1 1 2

avatar image Tuerer Nov 28 '18 at 03:02 PM

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?

avatar image Zoinks360 Nov 29 '18 at 02:25 AM

Hey Tuerer,

Thanks for your response.

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

(See pic below)

alt text

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)

alt text

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!

avatar image Tuerer Nov 29 '18 at 06:53 AM

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?

avatar image Zoinks360 Nov 30 '18 at 02:38 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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)

alt text

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)

alt text

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)

alt text

more ▼

answered Dec 01 '18 at 04:58 AM

avatar image

Zoinks360
1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question