Viewport, RigidBody, and CPUParticeSystems

Godot Version

v4.2.1.stable.mono.official [b09f793f5]


Praying someone can help me, because I’m absolutely at my wits’ end :frowning: :frowning: :frowning:

My hierarchy looked like this:

– Area2D (for localized gravity manipulation)
---- RigidBody2D(s)
------ CPUParticles2D

Everything worked fine (e.g. the simulation occurring on the rigid bodies) at this point. Then I decided I didn’t want the Subviewport anymore, and replaced it with a Node2D:

– Area2D (for localized gravity manipulation)
---- RigidBody2D(s)
------ CPUParticles2D

Suddenly, the RigidBodies seemed to stop getting physics. They got _Process calls, but gravity, impulse, and torque stops working on them. They just sit there.

If I change the engine time scale to 2.0, IT WORKS AGAIN.

If I don’t change the engine time scale, but remove the CPUParticles2D child IT WORKS.

Changing CPUParticles2D to GPUParticles2D does not do anything to improve the situation.

Please, I hope someone can help. I’ve spent hours pulling my hair out over this and it’s blocking my progress, because I HAVE to get rid of that Subviewport.

I figured out what was going on while trying to make minimal repro case.

I had a screen shake script attached to the Subviewport or Node2D. Every frame it set the position of the Node2D (even if the screen wasn’t shaking). Changing the position seems to somehow interfere with the rigid body.

If I remove the screen shake script, it works fine. I should have been doing that in a camera anyway, but it’s some ancient I wrote wrong and forgot about…

Not totally clear why changing the position on the Node2D has that interaction w/ the rigid body and the particle system, but at this point, I’m unstuck.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.