#Area detection for health system
21 messages · Page 1 of 1 (latest)
would I place that into the signal function? I haven't used godot for a long time
You put on the enemy script
class_name Enemy at the top
And that if check in to the signal
so in my enemy script i'd put
class_name Enemy
and then in the signal I'd put in
If body == Enemy:
health -= 1
?
Yes
thx man!
ok so the area won't detect the enemy
they're touching so the health bar should appear
what root node is the enemy
a characterbody
then you want _on_body_entered(body) signal not area2d shape
they're connected to this body entered thing, why is it named on_area?
the area node is called area_2d
ohhh wait im dumb
i did connect them so it should work
did it work?