Download

Single component aiming at player without actor rotation

Hi guys,

do anyone know if its possible to make a single component of blueprint aiming at player (and shooting projectiles at him for example) without rotating the whole actor? I was trying to achieve that with “Find look at rotation” but the enemy is shooting only forwards and backwards. I have something like this:

I was trying to “Set World Rotation” of that Gun component and even connected it to Event Tick, but it still wasn’t working properly.

Any help appreciated.

You can make blueprintable scene component. Inside it find ITS look at rotation. Then either apply it to world rotation or relative rotation (depends how you calculate look at target rotation). When you have this component add it to actor bluprint, and place your gun, lazer or whatever you want as its child component.

Find look at rotation requires 2 locations, not location and forward vector. Because forward vector is normalized (always length of 1), when feed to find at rotation acts like [0,0,0] vector ie. center of level. So you basically finding rotation from object in center, not from your gun.

Put there “get component world location” instead of forward vector.

Thank you for the explanation. “Get component world location” did the job. It’s working like a charm now, thank you very much