Skip to main content

Example Map

Examples/Maps/TurretExample shows both turret types, different sight ranges and the team system.

Example Map Overview

Controls​

KeyAction
WASD, mouse, SpaceMove, look, jump
FToggle firing on or off
TToggle tracking on or off

Signs in the map show the keys.

What's in the map​

Turrets​

The map has both turret types, B_TurretPawn (dual barrel) and B_TurretPawn2 (single barrel). They use the example controllers in Examples/Blueprints, which differ in sight range. The cylinders on the floor show the radius, and the signs next to them say how far it is.

ControllerPurpose
B_TurretAIController_01, _02, _03Children of B_TurretAIController with different sight radii
B_TurretAIController_AlwaysFriendlyNever attacks: its GetTeamAttitude returns Friendly

Team pads​

Step on a B_TeamPad to take its team. Turrets of that team stop attacking you; the others keep firing.

The pad:

  1. sets the TeamID of your B_TeamPlayerController,
  2. changes your character's material to the team color,
  3. calls Request Stimuli Listener Update on the AI perception of every turret controller, so the turrets re-evaluate you at once.

Game mode​

The map uses Examples/Blueprints/BP_ThirdPersonGameMode with:

  • Player Controller: B_TeamPlayerController, a child of the C++ ATeamPlayerController, which implements IGenericTeamAgentInterface
  • Default Pawn: BP_ThirdPersonCharacter

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 team pad and approach a turret of that team and one of another.
  5. Multiplayer: in Play settings, set 2 players and Play As Listen Server. Both players see the turrets aim and fire.