Child Turret Rotation Problem

Hello. I am creating turrets that are child actor components of a large ship, and I rotate the yaw of the body of the turrets to face the target (the barrels then do pitch).

The problem is, if the parent ship rolls or pitches, the turret will not follow because I am setting it’s world rotation.

I can not set the pitch and roll world rotation to that of the parents at the same time as I do the yaw, because the yaw changes what the pitch is (IE it’ll be rotated differently than the parent so pitch rotates it in different direction than the pitch of the larger ship)

I’ve tried many ways around this but can’t seem to solve the issue.

Any suggestions?

Hey Pinworm,

Here is a download to a project I put together that shows how to setup some turrets on a ship that will face a enemy and shoot a projectile at it.



Thanks, but unfortunately this method didn’t work for me. I had the same problem. Presumably, because I have my ship mesh as the root, and you have a scene component as the root… I believe that’s the issue.

Can I not do this while keeping my ship mesh as the root? That would be highly preferable, I’d have to do a lot of mucking about otherwise.

Thanks again, hopefully I can do some math to simply alter the turrets pitch, using the parents pitch, instead of the turrets pitch… if that makes sense. There’s got to be a simple way to do this.

Edit: Nevermind, the issue was you don’t edit the “TurretBody” Rotation at all. I need to edit it’s yaw but maintain the pitch and roll of the parent. I don’t know how to get that relative information