Bone does not change rotation in X and Y axes, but works well on Z.

Hello!

I have a simple tank pawn, with skeletal mesh as root component. It contains 1 physics body for collisions and 2 bones: 1 for turret and one parent bone for the body.

Now I want to bind xbox controller bumper position to the rotation of the tank’s turret (it is a top down game) and it works well. I achieved that via animation blueprint (Fig 1). As you can see it is set to world space and replace existing.

Since Animation blueprint would be setting X and Y values to 0 due to replace mode and reference to world space, I am adding Root Component’s X and Y rotations to the X and Y rotations of the Rotation0 used for animating turret bone but it just does not work (Fig 2). It seems like the turret is locked on pitch and roll and when the Tank actor tips over, the turret remains level to the ground.

Am I missing something? Is that a bug? Maybe there is a way to lock rotation axes separately for bones like you can do in static meshes? OR maybe a way to separate X and Y axes and put them into parent bone space?

Fig1.

Fig2.

After 6 hours I believe I have tried everything, and hope for some fresh eyes to see my problem.

I thank you in advance.

Regards!

Ladies and gentlemen. While a brief problem, it shows again to not underestimate a good night’s sleep!

I’ve been testing this and it seems to be working.

So instead of rotating the turret on it’s world space, I have opted to rotate it on it’s own Bone space and just subtract the current actor rotation in world (also -90° because my level is rotated) leaving me with working featurere. Here are figs for reference:

Fig. 1 Anim BP

Fig. 2 Turret Rotation function

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