Skip to main content

Example Map

Maps/L_TurretExample shows the turret variants, teams and destruction.

Example Map Overview

Controls​

KeyAction
WASD, mouse, SpaceMove, look, jump
FToggle firing on every turret
TToggle tracking on every turret
XDeal 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:

ControllerSight radius
BP_TurretAIController_01600 cm
BP_TurretAIController_021500 cm
BP_TurretAIController_032000 cm
BP_TurretAIController_AlwaysFriendly600 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 implements BPI_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​

  1. Detection: approach a turret slowly. It turns to you once you enter its sight radius.
  2. Lead: run sideways past a turret. The shots land where you are going, not where you were.
  3. Line of sight: break line of sight behind cover. After TrackingTimeout (3 s) the turret returns to its base position.
  4. Teams: step on a TeamPad and approach a turret of that team and one of another.
  5. Multiplayer: in Play settings, set 2 players and Play As Listen Server. Damage and destruction show on both screens.