+2 votes

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 areaentered signal when they overlap after pausing (I get an empty array on getoverlapping_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?

in Engine by (16 points)

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?

1 Answer

+3 votes

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:

Physics2DServer.set_active(true)

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

by (4,155 points)

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.