Make area_entered and area_exited work during the game pause?

Godot Version

4.4

Question

I have a requirement in that the player will be moving some objects in the pause menu and these objects used area_entered and area_exited to check whether they collide with another object or not.

The thing is when I paused the game, I see that the signal area_entered and area_exited stop signalling.

I have already tried area.process_mode = Node.PROCESS_MODE_ALWAYS. When I paused the game, I see the _process function is still processing when the game has already paused. area_entered and area_exited however only get called when the game is not paused.

So how to make area_entered and area_exited got called during the pause?

Help > Programming

Seems like you have to reenable the PhysicsServer2D after the pause. Testing with two Area2D objects where both have process_mode = PROCESS_MODE_ALWAYS. Using following script:

get_tree().paused = true
PhysicsServer2D.set_active(true)

now the signal function is called.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.