Hello! I’m making a game where you shoot enemies, and when they damage you, your health bar decreases. The thing is, I’m new to Godot, so I’ve been watching lots of different tutorials. I tried using two different tutorials for this function, but it’s not working. I don’t know if the problem is in the masks and layers or the general code. Please help, I’m stuck!! T0T
Make a onready var for the TextureProgressBar in the enemy script and add the health var in the health bar script outside of the function. Select the Area2D in the enemy, go from inspector to node, then connect the signal body_entered to the script. To decrease the player’s health in the enemy’s script, write the line ‘’‘textureprogressbar.health-=1’‘’ I hope this works.