Look At is 90° off

Hi. Very, very new to Unreal. Trying a system where the player character looks up and down in the direction of the camera while aiming. Made a rudimentary system following this guide (https://www.youtube.com/watch?v=s1ORDss2mNA). It works perfectly with Quinn. But when I use a mesh with retargeted animations, the Look At aiming seems to be about 90° off. The string text is showing the coordinates of that white sphere which is where the character is supposed to look. They’re all within the same character blueprint.

That’s how it looks with Quinn which is correct (though clamp is on here). I stripped down the animation blueprint logic on the new mesh because of a separate control rig error (at least, I think it’s separate) and to isolate single bones to see what was happening. This is what it looks like on the new mesh. It’s set up almost exactly the same on Quinn. I tried playing with Look Up Axis settings and even subtracting or multiplying vector values but it either does nothing or affects the twisting in the wrong way.

Look at alpha just triggers to 1 from the character blueprint when I want the leaning to start (when the aim buttons are pressed). And look at location updates every tick based on that white sphere’s location. I tried set world location and relative location but neither fixed the issue. Also, maybe unrelated, but I’ve looked at the retargeted animations and they look great, nothing is rotated incorrectly. Don’t know if that narrows down the issue.

Also open to a better “look at” system in general since this way wasn’t working - neither on Quinn nor the custom Mesh - when I wanted the character to lean in the direction of an interactive object. They would lean but in some direction I couldn’t figure out the math behind. So if there’s another system that solves the “lean with camera” problem and the “lean toward object” problem and jibes with my confused brain, I’d be willing to try something else entirely.

Thanks for any help!

If the lookat works with Quinn, but not your own mesh. it’s probably just the bone axis getting swapped on the trip between your modelling app, fbx, and UE.

Instead of using a lookat target, you could try getting the rotation delta between the character and either control rotation or base aim rotation, then use a modify/transorm bone node in anim graph and feed delta pitch into yaw or roll to swap the axis if bones are just wonky.

I had to do something like that in a third person project where the skelemshes from blender had the wrong primary bone axis on export.

You can also use the rot delta later to feed a standard aim offset player.

TLDR but it’s not. your mesh is rotate by 90 inside your character. and you are probably using the wrong object to calculate “look at” from.

I’m using a sphere called “Look At Target” that’s a child of the camera. Every tick its world transform is sent to a variable. The AnimBP reads that variable to use as the Look At target for animgraph function. It works perfectly for Quinn, who is set up the same way, but not for my mesh. I’ve tried getting relative transform instead but the issue remained.

I was worried it was an export issue. Once I… figure out how to do what you suggested (still fumbling around unreal, quite a bit haha) I will report back if it worked or not.

It’s not too hard, here’s the part in my anim bp where I adjust spine 1 and 2 to look up or down based on aim offset:

You can ignore the div node if only adjusting one bone, I just /2’d the pitch so each spine bone would only turn up or down by 45° when looking straight up or down so back wasn’t bending at a right angle lol. I used to to set Aim pitch in character bp with something like this:

But eventually switched to doing it in c++ with delta between control rot and actor rot

const FRotator DeltaRotator = UKismetMathLibrary::NormalizedDeltaRotator(ControlRotation, ActorRotation);

float TargetPitch = DeltaRotator.Pitch;

There’s more to the c++ than that where I compare velocity before finally finterping AimPitch to TargetPitch for anim graph to actually use. But that’s kinda overkill in most cases.

This seems to be working for me! I even kept the division node but mainly been using Alpha scale so some bones bend less than others. The mesh is finally bending the right way, thank you!