AI Turret (C++ plugin)
AI-controlled turrets that detect, track and fire projectiles at enemies. The aim leads the target, so it accounts for the target's direction and velocity.
The targeting and tracking run in C++. Blueprint children carry the meshes, effects and settings, so you tune and extend the turrets without touching code.

Key features
- AI perception targeting: turrets see enemies, track them and return to their base position when they lose them.
- Lead angle calculation: shots intercept a moving target (
UTargetingLibrary::CalculateFiringSolution). - Teams: friend/foe detection through Unreal's
IGenericTeamAgentInterface, the interface the engine's AI and Lyra use. - Single and dual barrel: two ready-made turrets, plus a low-poly variant of the single-barrel mesh.
- Multiplayer: the AI runs on the server, the aim replicates and shots show on every machine.
- Ready to use: drop
B_TurretPawninto a level and it works with the default values.
Which edition?
The AI Turret comes in two editions. They are equal choices; pick the one that fits your project.
- C++ plugin (this one): for large, performance-critical projects. Targeting and tracking run in native code.
- Blueprint edition: for most projects. Pure Blueprint, easier to integrate: no code module, no plugin to enable.
| C++ plugin | Blueprint edition | |
|---|---|---|
| Unreal Engine | 5.4 – 5.8 | 5.7 – 5.8 |
| Ships as | Code plugin | Asset pack in Content/AITurret |
| Targeting and tracking | C++ | Blueprint |
| Settings, meshes, effects, damage handling | Blueprint (children of the C++ classes) | Blueprint |
| Teams | IGenericTeamAgentInterface | BPI_TeamAgent |
| Turret health and destruction | Not included; add your own | Included: health, damage states, debris |
| Projectiles | Fly until they hit | Expire after 5 seconds |
| Dual barrels | Fire parallel | Converge on the target |
What's included
- Three turret skeletal meshes (one dual barrel, a single barrel in high and low poly) and two Animation Blueprints (
ABP_Turret,ABP_Turret2) for procedural aiming B_TurretPawn(dual barrel) andB_TurretPawn2(single barrel), with their AI controller and projectile- Niagara effects for the muzzle flash and the projectile, plus sound effects
- The example map
TurretExamplewith team pads and turret variants - The C++ classes
ATurretPawn,ATurretAIController,ATurretProjectile,ATurretPlasmaProjectileandATeamPlayerController, plus the function libraryUTargetingLibrary
System requirements
- Unreal Engine: 5.4 – 5.8
- Platforms: Win64, Mac, Linux, iOS, Android (the plugin module's platform list)
- Dependencies: Niagara (optional, for the effects; enabled by default in new projects)
Get the plugin
Next steps
- Setup Guide: install, enable the plugin, place a turret.
- Example Map: what the demo shows and its controls.
- Customization: range, speed, fire rate, teams, damage, your own mesh.
- Blueprint Reference: every class, property and function.
- Lyra Integration: turrets that deal damage through Lyra's Gameplay Ability System.
Support
- Discord Server: direct support and community
- YouTube Showcase: the plugin in action