This page aims to explain the technical details of the Health System Component. Here, you will find tables showing the available properties and functions for this component.
Overview
The Health System Component contains five properties, six functions and two event dispatchers. This section of the page contains detailed information about each of these elements, presented in tables for easier understanding.
5Properties
6 Functions
2Event Dispatcher
Properties
The health system comes with a selection of properties that are used throughout the system. Below, you will find a table containing all the properties and some general information.
Name
Type
Description
Health
Float
The exposed editor setting used to define the starting health.
Auto Destroy
Boolean
This defines whether the actor should be destroyed when the owner dies.
Maximal Health
Float
This stores the maximum health limit. This is set based on the initial health when the component is first set up.
Current Health
Float
The current state of the healthcare system.
Cached State
EHealthState
This is the current state of the health system. This is used to check whether the state has changed when health is manipulated.
Functions
The Health System Component comes with a range of public and private functions that can be used to access or modify health data. Below, you will find a table containing details of all the systems functions and some general information.
Name
Access
Description
Get Health
public
Getter function to safely access the current health value.
Get Health Percentage
public
Use the getter function to safely access the health value as a percentage, clamped between 0 and 1.
Get Health State
public
Getter function to safely access the current state of the health system.
Damage
public
Function to apply damage to the health system.
Heal
public
Function to apply heal / health to the health system.
Destroy Owner
private
Destroys the owner once they die. This can be toggled via the 'Auto Destroy' property.
Event Dispatcher
The Health System Component comes with event dispatchers that allow you to monitor important changes within the system without having to check the code yourself. See the table below for a list of all the included event dispatchers and some general information.
Name
Returns
Description
On Value Changed
Float
Called when the value stored in the health system component has been changed.