func _physics_process(_delta: float) → void:
for coll in $Area2D.get_overlapping_bodies():
if coll is Pointer:
print(“HIT”)
self.visible = true
When going into the menu (pausing the scene tree), the area2d works as normal, but then when moving the cursor outside the area2d, it doesn’t update, and area2d keeps printing HIT. However, when closing and reopening the menu, if the cursor is outside the region, it will stop printing. Basically it seems the cursor’s position only updates when reloading the menu, but I can see it moving and double checked the position is changing. I hope that makes sense. I’m suspecting it has to do with when the area2d polls whats within it at the wrong time, or something with the cursor’s position. Thanks!!
I found the reason, when I enable PhysicsServer2D.set_active(true), it works. So it has to do with me pausing the game and physics not be active or something. Any workaround?
Often when something requires extensive work arounds it means that you approach the problem in the wrong way.
Read the first reply from gertkeno and you will solve the problem quicker and with better results than you’ll do by finding a workaround that makes your solution work … until it breaks and you have to debug.