godotengine / godotengine/godot
StaticBody3D collisions does not scan layers of RigidBody3D
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in 4.2.1, 4.3.dev4
### System information
Godot v4.3.dev4 - Ubuntu 23.10 23.10 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 () - Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 Threads)
### Issue description
In a 3D scene with a static body (ground) on collision layer 1 scanning layer 1, and rigid body on layer 1 not scanning any layer, the rigid body passes through the ground.
The scene setup:


When run:

When collision masks are swapped (rigid body scans, static body does no longer scan):

I would have expected, because the rigid body is in layer 1, and ground scans that layer, that the rigid body be stopped by it.
This happens with different collision shapes, and order of nodes does not influence the result.
Either this is a bug, or it is missing from documentations that static bodies never scan collision layers of other objects.
On one hand, it could make sense that because they dont move, static bodies would not get to scan other bodies. But on the other hand, when I asked on discord, someone said that it was working for them, and also this observation makes the ragdoll tutorial form the doc not work because it is setup the way I setup my scene, so that looks like a bug more than a doc problem, so I open an issue in this repo.
### Steps to reproduce
Just run the MRP. Maybe you'll need to enable visible collision shapes.

You may change collision masks to see that the other way around, when the rigid body scans layers and not the static body, collisions work as expected.
### Minimal reproduction project (MRP)
[collision-scan.zip](https://github.com/godotengine/godot/files/14528486/collision-scan.zip)
Contributor guide
Research direction
Start by running the linked collision-scan.zip minimal reproduction project in Godot and verify the two collision-mask configurations described in the issue. Compare the observed StaticBody3D and RigidBody3D behavior with the ragdoll tutorial setup; done means the intended collision behavior is established and either corrected or documented.
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