godotengine / godotengine/godot

StaticBody3D collisions does not scan layers of RigidBody3D

Open
#89,259 9 comments 0 reactions 0 assignees View on GitHub
discussion documentation topic:physics
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:
![image](https://github.com/godotengine/godot/assets/44928041/f68c8d04-3002-4add-a0cf-d0072b37f103)
![image](https://github.com/godotengine/godot/assets/44928041/34daf2fd-d867-4d2f-8365-1d8bb1a0bab6)
When run:
![image](https://github.com/godotengine/godot/assets/44928041/4af87dc2-6b37-4810-8ce8-9b718c242ca8)
When collision masks are swapped (rigid body scans, static body does no longer scan):
![image](https://github.com/godotengine/godot/assets/44928041/57d0effa-2281-477c-bcee-44d548066085)

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.
![image](https://github.com/godotengine/godot/assets/44928041/4089df78-db2d-48ab-82c9-4edcd5e01ba3)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.