Skip to content

Object Health

Gives a GameObject properties for the Combat System. Pairs well with the Damage and Game Instance Controller components.

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.

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.

Maximum shield a player can have.

Time in seconds before shield starts regenerating.

Shield recovered per second.

Shield value at which regeneration stops.

string. Copied into the base class referenceID so the object-health system can identify this object. Set from the inspector.

DownBehavior enum:

  • Destroy Deletes the GameObject when it goes down.
  • Respawn After Time Respawns after respawnTime seconds.
  • Respawn On Round Start (Requires Game Instance Controller) Respawns when a round starts.
  • Respawn On Round End (Requires Game Instance Controller) Respawns when a round ends.
  • Respawn On Game Start (Requires Game Instance Controller) Respawns when the game starts.
  • Respawn On Game End (Requires Game Instance Controller) Respawns when the game ends.
  • Manual Respawn is not automatic; call Respawn() from an interactable action or scripting.

Only used with Respawn After Time. Number of seconds before respawn.

Transform the GameObject respawns at.

(Requires Game Instance Controller) The Game Instance Controller the GameObject is bound to.

Hooks triggered by the Combat System.

Fires when the GameObject’s health reaches 0.

Fires when the GameObject respawns.

  • ObjectHealth extends Health from ABI.CCK.Scripts/Health.cs. Health / armor / shield base, max, and regen fields come from the base class.
  • A static ColliderIndex dictionary keyed by this GameObject’s Collider is maintained so the combat system can resolve hits quickly.

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