BUILD. CONFIGURE. TARGET. FIRE.
Modular Turret System provides configurable automated turrets for tower defense, strategy, survival, action, base-defense, and other Unity projects that need automated weapon platforms.
Show full description...
Turrets automatically acquire hostile targets, rotate independent tower and barrel pivots, check line of sight, wait until the weapon is correctly aligned, and fire using the selected weapon profile.
Start with the included Machine Gun, Cannon, or Laser, customize their behavior, replace the visual meshes, or use the system as a foundation for your own turret designs.
🤖 Automatic Target Acquisition
Turrets can automatically search for valid hostile targets inside their configured detection range.
- Automatic hostile target detection
- Configurable targeting range
- Layer filtering
- Team filtering
- Line-of-sight checks
- Automatic target replacement
- Firing only after alignment
This makes the system suitable for defensive structures, automated base weapons, enemy installations, tower-defense units, security systems, and other autonomous weapons.
🎯 Independent Yaw & Pitch Aiming
Turret rotation is separated into yaw and pitch pivots, allowing the tower and barrel to track targets independently.
- Separate horizontal yaw pivot
- Separate vertical pitch pivot
- Adjustable yaw rotation speed
- Adjustable pitch rotation speed
- Configurable elevation limits
- Configurable firing tolerance
The turret waits until its aim falls within the configured tolerance before firing, helping prevent shots from being released while the barrel is still rotating toward its target.
🔫 Three Weapon Types
Machine Gun — Hitscan
Fast direct-fire weapon behavior suitable for machine guns, automated rifles, rapid defense turrets, and similar weapons.
Cannon — Projectile
Uses straight-line physical projectiles with pooling, swept collision detection, and optional splash damage.
Laser — Pulsed Beam
Provides pulsed laser-style firing for sci-fi weapons, energy defenses, security systems, and futuristic turrets.
📊 ScriptableObject Weapon Profiles
Weapon behavior is configured through reusable ScriptableObject profiles.
Profiles can define values such as:
- Damage
- Firing rate
- Range
- Weapon type
- Heat capacity
- Heat generated per shot
- Cooling rate
- Recovery threshold
Profiles can be reused between multiple turrets and switched during runtime, making it easier to create weapon variants without duplicating the complete turret configuration.
🔥 Heat & Overheating
Weapons can accumulate heat every time they fire. Once the configured heat capacity is reached, the weapon enters an overheated state and temporarily stops firing.
- Configurable heat capacity
- Heat generated per shot
- Continuous cooling
- Configurable recovery threshold
- Overheat state
- Automatic firing recovery
This can be used to balance rapid-fire weapons, create burst-oriented defenses, or make powerful turrets require cooling periods between attacks.
🛡️ Team System
The included team system controls which objects can be targeted and damaged.
Three teams are provided:
Turrets acquire hostile targets while friendly damage prevention helps stop allied units from damaging members of the same team.
Teams can also be switched during runtime, as demonstrated in the included scene.
👁️ Line-of-Sight Detection
Range alone does not have to determine whether a turret can attack. Optional line-of-sight filtering allows scene geometry to block targeting and firing.
Walls, structures, terrain objects, and other obstacles can therefore prevent a turret from attacking a target it cannot properly see.
💣 Projectile & Splash Damage
Projectile weapons include additional functionality for reliable runtime combat.
- Projectile pooling
- Straight-line projectile movement
- Swept collision detection
- Direct impact damage
- Splash damage
- Obstacle checks for splash damage
Pooling allows projectile instances to be reused instead of repeatedly creating and destroying objects during sustained combat.
❤️ Target Health & Damage
The package includes target health functionality for testing and integrating turret combat.
- Health values
- Damage handling
- Death handling
- Damage events
- Death events
You can use the supplied components or connect the turret system to your own health and gameplay architecture.
⚡ UnityEvents Integration
Important system states expose UnityEvents so custom gameplay, audio, UI, and effects can react without modifying the core turret logic.
Events are available for:
- Weapon firing
- Overheating
- Cooling / recovery
- Receiving damage
- Death
Connect your own muzzle flashes, sounds, alarms, animations, objectives, UI feedback, particles, or other systems.
🧩 Modular Visual Setup
The included prefabs provide ready starting points, but the turret logic is not limited to the supplied visual models.
Replace the meshes to match your game's art style or construct a turret using your own model with separate yaw and pitch pivots.
This makes the package useful for creating:
- Military gun turrets
- Sci-fi defense systems
- Base-defense weapons
- Tower-defense units
- Automated cannons
- Laser defenses
- Enemy installations
- Security weapons
🧪 Included Demo Scene
A configured demonstration scene is included for testing the complete system.
The demo contains:
- Moving targets
- Automatic target respawning
- Multiple turret weapon types
- Heat indicators
- Overheating demonstrations
- Controls for pausing turret fire
- Runtime team switching
Use the scene to test the asset immediately or as a reference while integrating the system into your own project.
📦 Included Content
- Modular turret runtime system
- Automatic target acquisition
- Yaw and pitch aiming
- Line-of-sight filtering
- Team system
- Health and damage system
- Heat and overheating system
- Projectile pooling
- Splash damage support
- Runtime weapon switching
- UnityEvents integration
- 7 configured prefabs
- 3 weapon profiles
- 1 configured demo scene
- Full C# source
- English TXT documentation
- English Markdown documentation
- English PDF documentation
🎯 Suitable For
- Tower defense games
- Strategy games
- Survival games
- Action games
- Base-defense games
- Sci-fi games
- Military games
- Sandbox projects
- Automated security systems
- Enemy defense installations
⚙️ Technical Details
- Unity: Unity 2022.3 LTS
- Physics: Unity 3D Physics
- Weapon Types: Hitscan, Projectile, Pulsed Laser
- Targeting: Range + Layer + Team + Line of Sight
- Aiming: Separate Yaw and Pitch Pivots
- Weapon Configuration: ScriptableObject Profiles
- Runtime Weapon Switching: Supported
- Projectile Pooling: Included
- Splash Damage: Included
- UnityEvents: Included
- Third-Party Dependencies: None
🎨 Render Pipeline
The included demo materials are configured for the Built-in Render Pipeline.
URP and HDRP projects require appropriate material conversion or replacement. The core turret, targeting, weapon, physics, heat, and team logic is not tied to the demo material appearance.
✅ Tested
- Unity 2022.3.62f3
- Windows standalone build
🚀 Quick Workflow
- Add or place a turret prefab.
- Configure its targeting range and hostile team rules.
- Assign the yaw and pitch pivots.
- Select or create a weapon profile.
- Configure damage, firing rate, range, and heat values.
- Connect optional UnityEvents for audio, VFX, or gameplay.
- Replace the included visual meshes with your own models if required.
- Run the scene and let the turret acquire hostile targets automatically.
🎯 Build Automated Defenses
Create rapid-fire machine-gun defenses, heavy cannons, futuristic laser platforms, enemy installations, or custom automated weapons using the same modular foundation.
Modular Turret System provides targeting, aiming, firing, teams, heat management, projectiles, damage, and integration hooks while leaving the final visual design and game-specific behavior under your control.