Example Map
Maps/L_TurretExample shows the turret variants, teams and destruction.
Controls
| Key | Action |
|---|---|
| WASD, mouse, Space | Move, look, jump |
| F | Toggle firing on every turret |
| T | Toggle tracking on every turret |
| X | Deal 12 damage to the turret in front of you |
A message at the top of the screen confirms each toggle and team change. It comes from the UI/WBP_DemoMessage widget, shown through BP_ThirdPersonCharacter.ShowDemoMessage.
What's in the map
Turrets
The map has both turret types, BP_TurretPawn (dual barrel) and BP_TurretPawn2 (single barrel), with different teams and scales. The example controllers in Blueprints/Examples differ in sight range:
| Controller | Sight radius |
|---|---|
BP_TurretAIController_01 | 600 cm |
BP_TurretAIController_02 | 1500 cm |
BP_TurretAIController_03 | 2000 cm |
BP_TurretAIController_AlwaysFriendly | 600 cm, never attacks (overrides GetTeamAttitude) |
TeamPads
Step on a BP_TeamPad to take its team. Turrets of that team stop attacking you; the others keep firing. The pad sets the TeamID on BP_TeamPlayerController and then calls OnTeamsChanged on every turret controller.
Destruction
Press X in front of a turret to damage it. Sparks, smoke and fire appear at 75 %, 50 % and 25 % health. At zero the turret is replaced by its debris actor, which breaks apart.
Game mode
The map uses Blueprints/Examples/BP_ThirdPersonGameMode with:
- Player Controller:
BP_TeamPlayerController, which implementsBPI_TeamAgent - Default Pawn:
BP_ThirdPersonCharacter
The map uses manual camera exposure in its PostProcessVolume, so it looks right whatever your project's exposure settings are.
Testing it
- Detection: approach a turret slowly. It turns to you once you enter its sight radius.
- Lead: run sideways past a turret. The shots land where you are going, not where you were.
- Line of sight: break line of sight behind cover. After
TrackingTimeout(3 s) the turret returns to its base position. - Teams: step on a TeamPad and approach a turret of that team and one of another.
- Multiplayer: in Play settings, set 2 players and Play As Listen Server. Damage and destruction show on both screens.