Need Help creating a Turret Blueprint

Hi everybody!
I need some help with the creation of a new turret blueprint. Specifically, I need to know how to rotate and adjust the pitch of the turret towards a targeted actor. The turret is a skeletal actor with a YawBone(b_Gun_Yaw) and a PitchBone(b_Gun_Pivot).

Thanks in advance for you help.

Did you search the forums before your posted? 8-}

[TUTORIAL] Creating Enemy A.I. (Turret)]([TUTORIAL] Creating Enemy A.I. (Turret) - Community Content, Tools and Tutorials - Unreal Engine Forums) … this should help you.

I made a Blueprint for a Custom Turret a few weeks ago. But mine uses several Static Meshes instead of skeletal ones. I can look for it and post it tomorrow if you are interesed.

Regards

I am interested … I would like to see that … we are about to implement turrets and Static Meshes are our preferred choice. 8-}

Alrigth, here we go.

I can post a few Screenshots now. I have to leave soon so this a bit rushed
If you have any questions i can answere them tomorrow i think. This is also not the best solution it works and im fine with that :).

Sentry Gun:


My Turret consists of 3 static meshes. The Base, a hinge for horizontal rotation and the Turret itself for vertical rotation.
The scanning component is looking for the nearest target and the weapon component is used for a trace shot.
“Set Multi Comp Rotation” rotates the Meshes to the target Position.
“Get Transformed Rotation to Target” is a nice function i found in the AnswereHub - I dont remember who posted it but i very thankful for his contribution.
With this function you are able to rotate the whole sentry and the roation will still work fine (I use this for wall and ceiling mounted turrets)

And here a little example picture. The traces are not visible but they all meet at the center of the target.

Regards

Sorry, I wasn’t thinking this morning. That video has been very helpful. Thanks!

That would be very cool. Thank You!

Wow! Very cool indeed! I will have to go poke around and see if I can find that custom “Rotation” routine you used in your example.

You solved my biggest problem!!! Million Thanks!!! :smiley:

Im fairly new to Unreal Engine. I cant find some of the functions e.g. Set Multi Comp Rotation, Get Transformed Rotation to Target…
Can somebody help me?

Those are custom functions that he made and is calling. He is manually adding the inputs and outputs so he can call those functions to get the right information for the turrets.

You can create a new function, add inputs and outputs, and then call those functions. He screenshotted all of them above, they’re near the bottom of the screenshots.

If you need more specific help just mention which step you’re on :slight_smile:

Thanks Pinworm. Alone mentioning the ability to add Input and Outputs in Custom Functions helped me. But got stuck again.

Could reproduce many parts of the Blueprints but only the “Scanner Component” with the “Target” to “First Target” couldnt be recreated.
Made some workaround and am going to test it later (probably in a few month). I dont have that much Information of the “Scanner Component” so I made it to a “Interp to Movement”.

a7d7773710f96705364ad2ef578ee3654648c1f5.jpeg

I found a ‘simple’ tutorial with another solution. Maybe mathematically its the same…
http://www.vaduunlabs.com/index.php/en/tutorials/29-adv-turret-animation.html
There is also a youtube video for this on www.vaduunlabs.com.