Add to Health Bar | hyperPad Documentation

Loading...

Logo
DocumentationUIAdd to Health Bar
UI

Add to Health Bar

Last updated June 26, 2017

Description

The Add to Health Bar behavior will increase your health bar by adding a value to the current percentage. You can also use negative numbers to decrease the health bar.

The health bar is capped to 100%. Adding more after 100% will not have any results.

This behavior will trigger an event once it has met the designed condition.

Properties

Triggers Once on Event

Object A

This is the health bar that will be increased or decreased. If there is a health bar in your UI layers it will automatically be selected. If you do not have a health bar make sure to add one and then select it here.

Value

This is the amount to add to the health bar. Remember you can not exceed 100%

Event on Full

When this toggle switch is on, the behavior will trigger an event once the health bar reaches 100%.

By default, this toggle switch is off.

Event on Empty

When this toggle switch is on, the behavior will trigger an event once the health bar reaches 0%.

By default, this toggle switch is on.

Outputs

Health Bar Value

Returns the current health bar percentage

Object ID

This outputs the Object ID.

Examples

If you have a health pack item that when your player picks up (collides with), it will increase your health by 10% you can use this behavior.

Additionally, you can use this behavior when your player is being attacked and you want the health to go down. Eg. -10 will decrease the health by 10%.

Download Example Project

Get Health Bar

Set Health Bar

AddToHealthBarReference.gif