Does pausing stop area2d collision detection even when whitelisted?

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

I don’t know if this is the case, but I just wanted to ask to be sure:

I have the Pause Mode of my Area2D nodes (and their collision shapes) set to Process. I don’t, however, receive an area_entered signal when they overlap after pausing (I get an empty array on get_overlapping_areas() as well).

I am able to make them overlap in pause mode (as I’m drawing the area2d with my mouse) but the collisions are not reported, unless unpaused.

Is this the intended behavior?

I’ve noted the same behavior with the signals ‘mouse_entered()’, ‘mouse_exited()’ and ‘input_event( Node viewport, InputEvent event, int shape_idx)’ on Area2D nodes. It works just fine if the tree is unpaused, but if the tree is paused these signals are not emmited any more, even with the code:

self.get_tree().paused = true
Physics2DServer.set_active(true) # Like Dlean Jeans says

All the nodes are set with the enum value: ‘PAUSE_MODE_PROCESS’. We’re using Godot 3.1; Can some one help?

In the test we used a button to pause and unpause the tree, and its signals seem to always work fine.

A much weirder behavior occurs when we tried to change the type to StaticBody2D, they seem to “defer” the signals emission to when the tree is unpaused, so a lot of things happen very quickly! Is this as it should be?

matheuskknd | 2019-08-02 00:36

:bust_in_silhouette: Reply From: Dlean Jeans

Yes, this is how it works. The physics server is stopped when the game is paused.

However, if you wanna keep it going, add this after you pause the game:


Note that this will also affect all other physics bodies even if their pause_mode is not Process.

Thank you for confirming this! I wasn’t able to find any info about this in the docs

owais91 | 2019-05-26 13:34