godotengine / godotengine/godot
GPUParticle2D spawns particles at the wrong location when `GPUParticle2D.inherit_velocity_ratio` > 0
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in: v4.3.dev5.official [c9c17d6ca]
### System information
Godot v4.3.dev5 - Ubuntu 23.10 23.10 - X11 - GLES3 (Compatibility) - Mesa Intel(R) UHD Graphics (CML GT2) () - Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 Threads)
### Issue description
When a GPUParticle2D is set to be a child of RigidBody2D, with `GPUParticle2D.inherit_velocity_ratio` > 0, the particles are spawned between the expected location and a location ahead of the body's movement.
See this recording of the MRP:
[Screencast from 2024-03-22 03-14-07.webm](https://github.com/godotengine/godot/assets/44928041/4cfbdd49-a6e9-4d4f-87a4-f095780ec90d)
### Steps to reproduce
- Open the MRP.
- Use arrow keys to move to add to your velocity.
- Observe particles spawning at the wrong location.
### Minimal reproduction project (MRP)
[particles_inherited_velocity.zip](https://github.com/godotengine/godot/files/14716178/particles_inherited_velocity.zip)
Note: Gravity and damping are disabled in this MRP.
Contributor guide
Research direction
Open the attached particles_inherited_velocity.zip MRP and reproduce the issue by using the arrow keys to add velocity. Investigate GPUParticle2D behavior with inherit_velocity_ratio greater than zero; the fix is complete when particles spawn at the expected location instead of ahead of the moving RigidBody2D.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100