#Area detection for health system

21 messages · Page 1 of 1 (latest)

willow kindle
#

i set the progressbar to 100, so if it were to go 99 that means it detected it's own collision

#

if anyone could help that'd be great

sonic pelican
#

Give the enemies a class name

#

If body == Enemy:
health -= 1

willow kindle
sonic pelican
#

You put on the enemy script
class_name Enemy at the top
And that if check in to the signal

willow kindle
sonic pelican
#

Yes

willow kindle
#

thx man!

willow kindle
#

they're touching so the health bar should appear

sonic pelican
#

what root node is the enemy

willow kindle
#

a characterbody

sonic pelican
#

then you want _on_body_entered(body) signal not area2d shape

willow kindle
sonic pelican
#

the area node is called area_2d

willow kindle
#

ohhh wait im dumb

willow kindle
tropic coral
#

did it work?