9 lines
208 B
GDScript3
9 lines
208 B
GDScript3
![]() |
class_name HealthBar extends Control
|
||
|
|
||
|
@onready var bar: ColorRect = $ColorRect2
|
||
|
@export var maxHealth: float = 1
|
||
|
|
||
|
func healthChanged(health):
|
||
|
print("Health Changed")
|
||
|
bar.size.y = (health / maxHealth) * 100
|