-
-
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
GPUParticles2D Ignore Parent's "Disabled" Process Mode When Running Game #75218
Comments
Strangely it works if you set the mode while running, but not if it is set at start, this is because when a child is added the paused notifications are not triggered |
Hi, I found this issue as a "good first issue", and am trying to implement a fix. What I've done locally and what works it to create a method, _update_speed_scale, which encapsulates the can_process check, and call it during both pause/unpause notifications as well as tree entry. Do folks think this is a reasonable approach? If so, I'll submit a PR. This would be my first contribution to Godot, so sorry in advance if there's something stupid about this approach :) |
I think this should work well, it's what I thought as a solution when seeing this, using a separate function is useful but could be easier to just copy the code Remember to run |
Thanks! I wasn't sure what was "the norm" was in Godot re: when to copy vs. encapsulate. I notice the codebase is not overly-encapsulated so I wasn't sure. (btw; wow, the codebase is SO clean + elegant!!) So would you prefer duplication or helper function as I've done? I'll read the guidelines and do my best to make a good patch. Thanks again for the prompt response! |
I don't think copy in this case increase the risk of making mistakes, and the usage is local within |
And swapping approach is a trivial change so won't block the success of the PR assuming the basic approach is correct, so use your own judgement |
Fix for godotengine#75218 Pause notifications are not sent when a node is added as a child. So GPUParticles2D should also obey its can_process status on ENTER_TREE, not just PAUSED/UNPAUSED.
Fix for godotengine#75218 Pause notifications are not sent when a node is added as a child. So GPUParticles2D should also obey its can_process status on ENTER_TREE, not just PAUSED/UNPAUSED. (cherry picked from commit 4652fbd)
Godot version
v4.0.1.stable.official [cacf499]
System information
macOS Ventura 13.0.1 (22A400)
Issue description
I expected GPUParticles2D to not run when in a process mode = disabled subtree when set to process mode = inherit. But the GPUParticles2D process material still emits particles (while running, editor is fine).
GPUParticles2DIgnoreProcessModeDisabled.mp4
Steps to reproduce
Minimal reproduction project
BugDisabledGPUParticles2D.zip
The text was updated successfully, but these errors were encountered: