Area_entered and area_exited issues

Godot Version 4.5

Question:

Ok I feel like I’ve been asking way too many questions on here, but this one genuinely makes no sense. I’ve triple checked it, and made sure that the signals are connected and going where they need to go, but this simple code just hasn’t worked…

func _physics_process(_delta):
if in_enemy_range == true:
		print(hp)
		hp -= 5
		print(hp)

func _on_hitbox_area_entered(_area: Area2D) -> void:
	in_enemy_range = true

func _on_hitbox_area_exited(_area: Area2D) -> void:
	in_enemy_range = false

Tbh this could totally be a simple mistake and I’m just passing by the solution…

edit: to clarify, nothing prints or does anything when I enter the area2D

Ok, it seems like it’s working, but only sometimes… I just typed some extra random code for another part and it just started (sort of) working?

Check if the collision layers/masks are set correctly.
Also, are you checking for an area or for a body? If it’s a body, it should be body_entered

Oh! Yeah thank you! I think thats probably it… Lemme test that.

It works, but only after I run the code for my dash/roll… I think part of that could be interfering with the rest, so I’ll have to check that. Thank you for the help!