godot icon indicating copy to clipboard operation
godot copied to clipboard

GPU Particle Attractor has no effect on stationary particles (GPUParticle3D)

Open peterhoglund opened this issue 1 year ago • 4 comments

Tested versions

v4.2.1.stable.official [b09f793f5]

System information

4.2 stable, Windows 10 - Vulkan Forward+ - Nvidia GeForce RTX 2070 Super

Issue description

I'm trying to use a particle attractor to shoot away particles that have landed (collided) on a surface. The attractor works fine as long as they are moving, but when they land on the surface and become still the attractor don't have any effect on the particles.

I have set the Collision to Rigid and Friction to 0. I've tried Bounce from 0 and above (with a bounce of 1 the attractor work as the particle has bounced off the surface and is in the air again).

Steps to reproduce

Create a GPU Particle 3D Create a GPU Particle Collision Box Create a GPU Particle Attractor Box 3D

Assign a sphere shape to the Particle and turn Collision on, set to Rigid and Friction to 0 and Bounce to 0 Have the particles land on the Collision box and become still Move the Attractor over the particles to have them move. They are not affected by the Attractor

Minimal reproduction project (MRP)

ParticleTestProjectX.zip

peterhoglund avatar Jan 15 '24 15:01 peterhoglund

Please provide a minimum project to make this easier to test 🙂

  • A small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the .godot folder in the archive (but keep project.godot).
  • Having an MRP is very important for contributors to be able to reproduce the bug in the same way that you are experiencing it. When testing a potential fix for the issue, contributors will use the MRP to validate that the fix is working as intended.
  • If the reproduction steps are not project dependent (e.g. the bug is visible in a brand new project), you can write "N/A" in the field.
  • Drag and drop a ZIP archive to upload it (max 10 MB). Do not select another field until the project is done uploading.
  • Note for C# users: If your issue is not C#-specific, please upload a minimal reproduction project written in GDScript. This will make it easier for contributors to reproduce the issue locally as not everyone has a .NET setup available.

AThousandShips avatar Jan 15 '24 16:01 AThousandShips

@AThousandShips I've added a test project. Let me know if it doesn't work as expected.

peterhoglund avatar Jan 16 '24 08:01 peterhoglund

I did some testing. It seems what happens is that one of the "collided" states of a particle sets it velocity to 0 unless there is a massive change in velocity. The force the attractor applies to the particle is not enough to push it out this state causing the particle to look stuck.

Rudolph-B avatar Jan 18 '24 00:01 Rudolph-B

I think I have a fix but it is definitely going to change existing behavior. Doing some more testing.

Rudolph-B avatar Jan 18 '24 00:01 Rudolph-B