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:
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!
Another person told me to plug the Look At Rotation directly into the output in my function, but that returned wildly unusable results–I think the look at rotation seems to be in world space while the head look in my anim graph is being applied in local space (if I’m using that terminology correctly).
I got a chance to mess with this a bit more, and a coworker suggested this alternate setup–I don’t really understand how it works but I figured it was worth a try:
It didn’t fix the problem, which still persists (although now the character’s head seems to twitch around in ways that it didn’t before, so it’s slightly worse). Video of the new setup