Collision body detection problem

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lalel345

when collision is detected I want health to be subtracted from -10 only

if get_colliding_bodies():
	health -= 10

but only once and not progressively since godot is subtracting 10 from me each frame, that is, I want life to remain at 90 and only subtract once, not to progressively lower until it remains at 0

:bust_in_silhouette: Reply From: elrico26

makes a varieble that is like
var damage = false
then you put what
if damage == false:
hp - = 10
damage = true

and later if you want to put as a timpo so that it can hurt again you use a timer node and put in the if $Timer. start then create the timer out sign and put the damege var to be false so that the lifetime