Skip to content

Combat System

Enables PvP and PvE gamemodes in your world. Pairs well with the Damage component and the Game Instance Controller component.

Read-only. Changing this breaks the component.

Default health each player starts with at the beginning of a game or round.

Maximum health a player can have.

Time in seconds before health starts regenerating.

Health recovered per second.

Health value at which regeneration stops.

Default armor each player starts with at the beginning of a game or round.

Maximum armor a player can have.

Time in seconds before armor starts regenerating.

Armor recovered per second.

Armor value at which regeneration stops.

Default shield each player starts with at the beginning of a game or round.

Maximum shield a player can have.

Time in seconds before shield starts regenerating.

Shield recovered per second.

Shield value at which regeneration stops.

Enables or disables the ability for players to damage teammates.

How the player respawns after being downed.

  • Respawn On World Uses the CVR World spawn point.
  • Respawn On Point Uses the transform of the Respawn Point property.
  • Respawn In Place Respawns the player at the location they were downed.

Transform used when Respawn Behavior is Respawn On Point.

Time after being downed before the player respawns.

Hooks triggered by the Combat System.

Fires when player health reaches 0.

Fires when the player is hit by the Damage component.

Fires when the player respawns after being downed.

Fires when the player is given health outside of health regeneration.

Hooks that fire in response to combat with other players.

Fires when a remote player brings the local player’s health to 0.

Fires when the local player brings a remote player’s health to 0.

Fires when the local player is hit by a remote player’s Damage component.

Fires when the local player hits a remote player with a Damage component.

Globals exposed to shaders each frame that stay in sync with the Combat System.

Vector4 of (currentHealth, healthMaxAmount, healthRegenerationDelay, Time.time - healthRegenerationTimer).

Vector4 of (currentArmor, armorMaxAmount, armorRegenerationDelay, Time.time - armorRegenerationTimer).

Vector4 of (currentShield, shieldMaxAmount, shieldRegenerationDelay, Time.time - shieldRegenerationTimer).

  • CombatSystem extends Health from ABI.CCK.Scripts/Health.cs. Health-related fields (healthBaseAmount, regen delays / rates / caps, and the armor / shield equivalents) come from that base class.
  • A single static CombatSystem.Instance is set on Start; only one combat system is active at a time.
  • Control Mode on the base class selects local (Local) vs server-driven (Server) updates. For the player-attached combat system, the local path computes regeneration, DoT ticks, and trigger / particle damage.
  • friendlyFire = false skips incoming damage from teammates via GameInstanceControllerManager.CheckEnemy.
  • RespawnIfNecessary() / Respawn() are public entry points if you want to force a respawn.

CVR-GameFiles/ABI.CCK.Components/CombatSystem.cs, CVR-GameFiles/ABI.CCK.Scripts/Health.cs