
- The player and enemy were using a cast progress variable that was part of the spell object, so they were altering it at the same time
8 lines
191 B
GDScript
8 lines
191 B
GDScript
class_name HealthBar extends Control
|
|
|
|
@onready var bar: ColorRect = $ColorRect2
|
|
@export var maxHealth: float = 1
|
|
|
|
func healthChanged(health) -> void:
|
|
bar.size.y = (health / maxHealth) * 100
|