MP DM Objective CTF


An example of how to extend MPDMObjectiveBase.cs for Capture The Flag/Capture the Objective style gameplay.

Note: MPDMObjectiveCTF extends MPDMObjectiveBase.cs and adds specific functionality for Capture The Flag/Capture the Objective style gameplay. It includes variables related to captures required to win, flag behavior, renderer color, pickup collider, and bonus collider. Adjust these variables as needed to match the requirements of your Capture The Flag gameplay.

Inspector Fields

Captures To Win

Type: int

Description: Specifies the number of times this flag needs to be captured for a round to be won. Once this number is reached, the round is considered won.

Default Value: 3

Respawn On Carrier Death

Type: bool

Description: Determines whether the flag should return to its start position if the carrier is killed. If set to true, the flag will be respawned. If set to false, the flag will be dropped at the position where the carrier was killed.

Default Value: false

Use Defending Team Color

Type: bool

Description: If true, the objective renderer color will be set to the defending team’s color as per MPTeamManager. If false, the renderer color will be blue for defenders and red for potential attackers. Leaving this at the default (true) provides clarity for Capture The Flag with multiple flags.

Default Value: true

Pickup Collider

Type: Collider

Description: The collider that will trigger the pickup of the flag or objective. Players can interact with this collider to pick up the flag.

Default Value: null

Bonus Collider

Type: Collider

Description: The collider representing the bonus zone, if any. This collider defines an area where bonus scoring or special effects can be triggered when a player carrying the flag enters it.

Default Value: null

What are your feelings
Updated on August 14, 2023