-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
CollisionObject2D _input_event ignores pause mode #3703
Comments
Still not fixed in 2.1 stable |
I've been able to reproduce your issue with your test project. The thing is that Apart from This opens two ways of handling this:
I'm not biased here nor can come with a solid opinion on which one is better. I hope my research helps with the discussion. I wonder what @reduz has to say about this. EDIT: Due to the compatibility breakage that will happen with 3.0 this is a good time to re-examine this. |
Note that in 3.0 it became |
@RandomShaper The solution I would like to see implemented is that RigidBody2Ds with PAUSE_MODE_PROCESS report that they're clicked on while the game is paused. Dropping the queued up input events from PAUSE_MODE_PROCESS objects would be even further from the expected behavior. |
What's the status on this issue in 3.0? |
Still happens in 3.0.2 Stable (win64). Below is essentially the same example project recreated in Godot 3: |
Thanks for checking and updating the example project. |
Still happens on 3.1 stable. |
Still happens on 3.2alpha3. |
Still happens in released 3.2 |
Confirming, still happens in 3.2. |
Still happens on Godot_v3.2.1-stable_x11.64 |
Is there any reason for this to still happen ? I think it is a pretty unexpected behavior even after reading the documentation. There is no mention of exceptions in the white listing. |
I'd still strongly argue that it's a bug which should be corrected -- it prevents a whole lot of reasonable behavior, requiring one to either create their own pause implementation (because the existing one doesn't allow for exceptions with these types of nodes) or create a bunch of redundant Control objects just so some parts of the game can function while the rest is paused. |
I'll check this again today and will try to fix it. |
I've been checking this and thinking how to address it. First of all, the main reason why the unwanted behavior happens is that That way, the internal physics processing of the root viewport keeps running so it process the picking input events, which is needed for 2D/3D physics nodes to get These are our options:
|
Wouldn't setting the root node (which I had to access via Right now all nodes default to PAUSE_MODE_INHERIT and, unless somewhere up on the scene tree something was set to PAUSE_MODE_PROCESS, they'll all pause when the game is paused. By setting the root node to PAUSE_MODE_PROCESS now all nodes by default don't pause, unless one wants to manually set all various nodes to PAUSE_MODE_STOP. Also, at least on the sample project, setting the root node to PAUSE_MODE_PROCESS and clicking on the PAUSE_MODE_STOP RigidBody2D (named "Pauses") causes that node to report that it was clicked. Even while the game is paused. That would seem to be the same problem happening in reverse -- |
Yes, I mistyped the root viewport path. You're right in that the workaround is not good enough. I'll try something and make a tentative PR. |
Please have a look at #39421. Or, even better, try it. Just don't forget to enable the new setting in the test or real project. |
That patch makes the example project behave as expected, both as written and with a few extra minor tests that came to mind. I don't have any real-world projects that have pause-problems right now but I do recall having seen similar complaints about pause functionality somewhere on the internet. If I can find them again I'll redirect them here; it'd be nice to know if this helps out the other complaints and I don't know enough about the core code to evaluate the overall wisdom and impact of the changes you implemented. Thanks for getting some traction on this problem. It's always demoralizing when you have to fight against the engine instead of work within it. |
According to the tutorial on pausing, whenever the game is paused,
_process(delta)
,_fixed_process(delta)
,_input(event)
, and_input_event(viewport, event, shape_idx)
will not be called.Supposedly, for any nodes who have
PAUSE_MODE_PROCESS
set, those functions will still be called. And indeed,_process(delta)
,_fixed_process(delta)
, and_input(event)
all appear to be called for any nodes who havePAUSE_MODE_PROCESS
set even while the game is paused. But such nodes will not call_input_event(viewport, event, shape_idx)
while paused, regardless of what the pause mode is set to. Instead they will just queue up all the events, and report them simultaneously when the game is unpaused.Attached is an Example. It has two RigidBody2Ds which both inherit the same script. One is set to Pause Mode Stop, the other is set to Pause Mode Process.
While the game is unpaused, both nodes report clicks in general and clicks on themselves specifically. When the game is paused, the one with Process Mode Process will still report on any general clicks, but it will not report that it has been clicked. This seems against the spirit of
PAUSE_MODE_PROCESS
, and makes it impossible to tell when a node was clicked on while the game was paused.When the game is unpaused, both nodes will report any clicks made on them as though they had just then happened, regardless of the pause setting.
This behavior occurs in both 1.1 Stable and 2.0 RC1 2016-02-09.
The text was updated successfully, but these errors were encountered: