Head Tracking (Rotation) problem in world space

Hi guys, I’ve been stuck with this problem for a while.

My setup for head tracking is quite humble, I’m just trying to modify a bone to look at a sphere. To achieve this I get the world location of socket attached to my head bone and I get the world location of the sphere component.

1.jpg *Looking fine in blueprint editor

2.jpg *Work as intended in blueprint editor

3.jpg *Bone not looking at the sphere in game

f8f2351d7116c25d7b562d222f184b59a693b038.jpeg *My Anim blueprint setup

5.jpg *Calculation for the head rotation rotator

This seems fine in the Blueprint editor but when I place her in the game. Things gone really wrong :(, I had no idea what could be causing this. Something to do with the world space? as far as I concern I did not use any local space for any calculation but it behave strangely only in the game.

Any ideas?

What are you settings inside of TransfromModifyBone and why are you replacing Roll rotation with negative Yaw rotation on last screenshot?

Hey thanks for the reply.

My setting in Transform modify bone is to add to existing on Rotation. The scale and transformation is remain ignored.

On the last screen shoot if I don’t replace the roll with negative Yaw rotation the head won’t follow the ball properly. I tried different settings and tried to ignore the Yaw but doing otherwise gave me strange results.

One point that I can’t understand is why does the character work perfectly fine in the blueprint editor but failed to do the same when placed on a level :(?
Right now I’m trying to follow a tutorial maybe there is another alternative

Edit: The find to look at node doesn’t really give on the Roll value… Moving the ball on the horizontal line has no effect UNLESS I hook up the Yaw of the look at node to the X of final rotation (This still give an inverted result so I inverted it which looks fine BUT IT"S NOT ON THE GAME EDITOR!!)

You should fix it with one axis at a time. First edit the horizontal movement part so when you move the ball to the right the head moves to the right as well. If it’s offset you can add a float value so it lines up. Then do the same with the vertical movement. You probably don’t need roll for something like this.

Roll from LookAtRotation comes into play when your UpVector is not aligned with Z axis. But in such case you would be using different nodes anyway. So you can actually ignore roll all together. There are couple of things you need to be aware of:

  • LookAtRotation assumes that object being rotates is aligned with X axis. Make sure that this is the case for the neck bone
  • space of Start and Target positions defined space in which rotation is calculated. Right now you provide world space coordinates so your rotation will be in world space too. If result is not combined in proper space with existing rotation it explains why it works correctly in editor but not scene - in editor, world space is aligned with local space of character as character is normally at the center of coordinate system. So check that you add rotation in world space, if there is no such option (I think there is) you will have to transform target location into character’s coordinate space first.

When you say you add to existing rotation, do you mean reference pose?


FIXED IT!.. Turns out I need to get the Actor rotation too… it make sense… I don’t know the math behind it, I kinda brute force my way out. But the pic work if anyone interested

Thanks a lot for helping. The setting for “add to existing rotation” can be found in the transform bone node. I think in the old version the roll out is called “Ignore and Additive”.

As far as I know I only involve world space location and rotation, but like you said I needed the rotation of the character in the world space.

Thanks m8, have a great day

it also depend on your character’s rotation in game, in your blueprint, maybe it lucky at proper rotation, try with Roll parameter too, not only Pitch parameter