Question about how to use LookAt in an AnimGraph

I’m trying to follow the UE5 “How to set up vehicles in Unreal Engine” tutorial (How to set up vehicles in Unreal Engine 5. When animating the sample vehicle, there’s a section that describes joining the suspension of the vehicle to the wheels using the “lookAt” skeletal controls. I can select the appropriate bone (Front Left suspension in the attached screenshot), but I can’t seem to figure out how to ‘join’ that to the Front Left wheel.

Does anyone have any advice? Thanks!

-Dan

The lookAt takes two main arguments, the “bone to modify” and the “look at target” under the “target” section of the node’s parameters, these will be the two vectors you need to calculate the direction.
So to make it work, you need to set the “bone” of the front left suspension as the bone to modify, and the bone where the suspension is supposed to be attached as the look at target, which I assume is the front left wheel.

This node has an unwanted default “look at location” value of (100, 0, 0),

image

if you really want a bone to look at another bone, which is exactly what it is supposed to do, you will probably want to set this vector to 0, 0, 0, to avoid having offsets in the final result.

And lastly, this node takes two additional important arguments, the “look at axis” and “look up axis” both of them under the first “skeletal control” section,

image

so you need to figure out which axis is parallel to the suspension pipe to supply this argument, which is probably the X axis because is the axis that is commonly used as the frontal, so you probably need to change the look up axis because the look at and look up can’t be the same axis. You can also just play around with these two vectors until you get the desired result, make sure they both have different values.

1 Like

Thanks Octolex - that’s what I needed! My suspension arms aren’t flopping around anymore.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.