Hi guys! I’ve got a problem here that I’ve asked several places for help and haven’t been able to find a solution. Here’s hoping!
My player character is a mech that auto-targets enemies and turns its head to look at them. So I’ve been trying to get the Look At Rotation from the player to the targeted enemy, sans the player’s current orientation, and use that to manipulate the player’s head bone, like this:
Get Head Rotation function (the FrontFacer socket and the -90 degrees are because the skeletal mesh is rotated 90 degrees):
Applying the rotation:
It ALMOST works. For enemies that are “north” of the player (for lack of a better term), it seems to work great. But if I turn around to target enemies to the “south,” the head’s up/down axis seems to get inverted. If I’m looking at enemies directly to the east and west, the head ***** over from side to side. Here’s a video of what I’m talking about:
Any thoughts? Am I doing something obviously wrong here? Thanks in advance!