Is there a way to locally rotate a mesh component, or make it ignore world rotation?

Hi

I have a turret base that walks around, with a component on the same hierarchy level that acts as the turret itself. The turret wanders randomly with AI, while the head rotates to look at a random point.

However, when the turret rotates, the head kinda flails around a bit.

I’m sure it’s not possible to make it ignore world rotation, but is there a way to achieve the effect I want, without the head doing what it’s doing when the AI rotates the pawn?

ezgif-3-e732e04741

An quick idea you could try : have an empty scene component that it’s always looking at world (0,0,0) and when the AI detects the player, attach the turret component to that component to have it rotate independent of the body.

For example:

TurretLookAt
TurretLookAtCrazy

Hope it helps.

Thank you! I’ll try that when I’m able.

Another issue I’m having is trying to make the turret head bob. It’s in the animation, and the animation works in the animation viewer (just using the same animation as the body walking), but when in game nothing happens. The head is using the same animation blueprint as the body. Do you have any ideas for this? Google isn’t helping.

Edit: Nevermind, I never actually set THAT animation blueprint’s character reference haha

1 Like