-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pause mode enabled stops body/area signals being raised on a scene that has pause mode set as Process #47326
Comments
@Calinou
Any short term fix suggestion would be appreciated as my game relies on this ability... |
It seems there's a typo in your pause/unpause script, this version works as expected:
In your current version, pressing the button the first time leaves the game unpaused, then pressing it again actually pauses the game (edited). With this fixed, the signals work as expected. |
No, the code is correct, I set paused to on when this mini-game is visible. But you've got me worried. Are you saying that when you set paused=true then physics stops? This is not in the documentation, it has no mention, it says when you set Process to TRUE on a node it and it's children will continue to work and ignore the pause mode. If so, what is the point it letting _process() continue but pause _physics_process(), it's like allowing half a scene from functioning? and how is it possible to get this working - this is a popup gui (like pip boy) with a mini game... |
Right now, in your test project, pressing the key twice doesn't revert the state to normal, it's setting pause to true, that's why the signals keep not being received. But beside that, I understand better what you're trying to do. By default, yes I can confirm the whole physics is paused when the tree is paused. It causes rigid bodies to stop colliding and getting forces applied, and no collision signal is sent. On the other hand, You can work around that by forcing physics to still be processed while paused, using |
My test case was me trying to refactor everything :) Yes, the purpose is this is a mini-game within a 'pip boy' that pauses the whole game but not this. If what you say is correct, I'll try it out. Why does process and physics process get called but signals on area/kinematic stop? This doesn't quite make sense to me, but either way it would be nice if it were mentioned in the docs the limitations of the pause mode. But thanks for your time and effort, I'll check it out. However, will this mean that my game behind that really is paused will really be paused (I have no rigid bodies, just area and kinematic)? |
Physics not being processed AT ALL when the game is paused is a BIG catch that absolutely needs to be called out in documentation... |
The reason behind this limitation is that the physics world can only be processed or paused as a whole, which includes checking for collision and sending signals. In Godot 4.0, the plan is to allow physics objects to be removed from the simulation or set to static when the game is paused, which will help with this limitation. But yeah, I agree the documentation in 3.2 could be clearer on this aspect. It only mentions that physics 2D/3D will be stopped when you pause the tree, without giving details about what it means. And the pause modes could have more details about this too: |
So if I don't have any rigid bodies and I call Physics2DServer.set_active(true) then pause my game leaving my mini-game running, will there be any side effects on my main game that is paused? Also, is it worth going to the documentation section and raising a 'request' for documentation update from somebody knowledgable enough to put something useful in the section? |
If your main game also uses 2D Physics, physics will keep running as a side effect. If it's a problem for you, the easiest way I can think about to work around this would be to disable physics in all your physics objects manually when you pause (probably by removing the nodes from the tree). For the long term, the best way to handle this case would be to have a new node type to allow creating separate physics worlds, so you could use it for your minigame and if needed, pause the physics for your main game only. I'll add it to the list of useful things to add in the future, I think it would be relatively easy to do.
Yes, it's a good idea! You can open a ticket in https://github.com/godotengine/godot-docs/issues and link to this issue. |
@pouleyKetchoupp At the minute I go through every animated tile and set it's speed to 0 which is quite painful and obviously easy to break when adding new animated resources. |
Great to hear this workaround works for you! The pause changes for 4.0 I was referring to are specific to physics nodes, animated textures are not part of it and need a separate discussion. |
I've found another issue, can you clarify to save wasting another issue, or if you think it's a bug or separate issue I can raise a ticket. If it is a bug/feature do you know a workaround? If I call: Tooltips for all gui controls stop working. I know you said physics is excluded but I guess tooltips are threaded and maybe it's been stopped at a global level too, but doesn't seem right given a major use-case for pause mode is config screens... |
IIRC there's an issue for tooltips not showing when paused and it's a bug @chucklepie |
Tooltips not being shown while paused was already reported in #29362. |
@Calinou thanks, like I always say I did search just github never seems to be very accomodating with matching. That bug seems to be not active and classed as requiring a documentation update only, so I've added some comments to it if you don't mind. I guess this case can be closed as the original bug was down to a known limitation of world physics. |
This pull request adds a small amendment to `SceneTree` describing the behavior `_physics_process()` when pausing the scene. `_physics_process` will completely stop processing collisions and signals whenever the scene is paused, however, the function will still receive calls. This addresses: godotengine#47326 (cherry picked from commit d62175e)
This pull request adds a small amendment to `SceneTree` describing the behavior `_physics_process()` when pausing the scene. `_physics_process` will completely stop processing collisions and signals whenever the scene is paused, however, the function will still receive calls. This addresses: godotengine#47326 (cherry picked from commit d62175e)
This pull request adds a small amendment to `SceneTree` describing the behavior `_physics_process()` when pausing the scene. `_physics_process` will completely stop processing collisions and signals whenever the scene is paused, however, the function will still receive calls. This addresses: godotengine#47326 (cherry picked from commit d62175e)
This pull request adds a small amendment to `SceneTree` describing the behavior `_physics_process()` when pausing the scene. `_physics_process` will completely stop processing collisions and signals whenever the scene is paused, however, the function will still receive calls. This addresses: godotengine#47326 (cherry picked from commit d62175e)
Godot version:
3.2.3
OS/device including version:
Linux mint
Issue description:
I have the following global code to toggle pausing so my main game pauses but a node (a mini-game popup in a gui) runs:
I have set pause mode as PROCESS for this 'popup' node. When the game runs, the scene is shown, the mini-game plays ok, i.e. pause mode is being ignored for this whole scene correctly. However none of the body or area entered signals within the scene are raised and no collisions occur, they are completely ignored, but the rest of the scene runs fine.
Please see below the little character going straight through the blocks. I have enabled collision visibility to show these are being generated ok
bunny1.mp4
Now, if I change the autoload to not pause the game, then everything works fine. So game_pause is stopping signals from being raised.
bunny2.mp4
Minimal reproduction project:
See below comments
The text was updated successfully, but these errors were encountered: