Download

Tank turret yaw and pitch keep snapping back into place

I was trying to do all I could inside the vehicle blueprint before making and using animation BP.

So I found a node called “Set bone rotation by name” that can be used inside a pawn BP. It needs a pose-able mesh reference, so I added a poseable mesh component in the viewport.

So I tried to easily set up movement of the turrent with the mouse x and y for pitch and yaw. It works, or should I say tries to work and then it quickly snaps back into the default place. I want it to hold those vectors input from the mouse and not snap back.

What I did find was changing the setting in bone space to component space from world space made it where the turret goes back to the default mesh position, whereas on world space it snaps I guess to the global x or z of the map.

But yeah, trying to figure out why it is snapping back in place and not holding the mouse input until changed.

Any help is appreciated, thanks.

Just add the current rotation to the current input. For example, for the yaw:

As a side note, for bone manipulations, I prefer doing them in the animation BP with nodes like “Transform (modify) Bone”.

Wow, it was really that easy thanks!. But now I have a new problem. While the turret or upper part of the tank, now, turns fine , the barrel is acting kind of how the turret and barrel acted before when I had the bone space set to world space VS component space. If I set the barrel to world space it does what it did before. If I set the barrel to component space, it seems to aim at a position in front and middle of the tank, and while pitch is working correctly for the barrel, if I turn the turret, the base of the barrel is not following the rotation of the turret, but the barrel is parented to the turret by the skeleton so it has to stay with the turret, but the turret…its kind of hard to explain. (see screenshot)

tank03

The skeletal mesh I’m using has the barrel divided into two parts. I’m using the closest part to the turret AS the barrel.

I just tried to make another set of nodes just for the second part of the barrel and used a sequence to split off the pitch axis input, and no effect. Any help is appreciated thanks.

Try something like this:

Notice that for the barrel uses the same nodes but instead of the yaw it’s the pitch. And now the important part: connect the resulting yaw from the turret to the yaw of the barrel.

If you familiar with Blender, when you rotate bones with Set Bone Rotation by Name, it’s like rotating the bone in edit mode instead of in Pose mode.

That was an excellent solution! I had not thought of that, worked like a charm, thank you!