Tank Barrel Pitch Rotation

My tank vehicle has a turret and barrel. I created a view widget and used line tracing to check if the object was on the view’s enemy widget. If it is on it, I use my sight, barrel and turret to turn towards the enemy vehicle and use find look at rotation while doing this. There is no problem on flat ground, but on rough terrain the barrel cannot detect the enemy vehicle correctly. What is the reason of this? What’s the solution?




Could it be that my pawn is adding its own rotation to the barrel bone?

@Mind-Brain
Do I need to turn off something from the pawn blueprint or is there something else ? :smiley:

I would be very happy if you could help me. I looked at almost all similar topics opened in the forum. I don’t know how to solve this problem

Set this settings in Transform (Modify) Bone

I’ll be back right away

@PREDALIEN
When I did this, I can say that it partially worked. I was actually doing this using world space at first. If I do Transform Bone World Space, the turret and barrel of the tank move separately from the body, this problem only occurs in rough terrain as seen in the picture, so although I used it this way at first, I later used the component area because I saw that this happened in rough terrain.

Well, the easy way did not lead to success, then try this. It works fine on my model.

image

Only you need to transfer the necessary angles to your animation blueprint.

1 Like

@PREDALIEN
thanks for everything . How can I prevent the turret from rotating with the main body? Do you have any suggestions on this matter?

How is your camera attached to the body? Perhaps this setup of the camera component, or spring arm, will suit you:
image

@PREDALIEN
I made the camera as you showed, but it did not allow the tank turret to rotate independently of the hull. Here is my tank setup and this is how I make the turret rotate.

When you rotate your pawn, does the turret rotate with the pawn? Or is the turret independent from the hull? How did you solve this problem? Because unless you are doing anything out of the ordinary, I think the tank turret should be independent from the hull.

The turret is attached to the body, but I constantly adjust its rotation depending on the camera’s view.
Spring Arm and camera are attached to the body, but rotate independently of it.

Here is my test blueprint:

Tank.uasset (235.3 KB)

1 Like

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