godotengine / godotengine/godot

[3D editor] Snap Object to Floor should check collision layer to snap object

Open
#111,409 0 comments 4 reactions 0 assignees View on GitHub
enhancement topic:3d topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- v4.5.stable.official [876b29033]

### System information

Nobara Linux 42, Windows 11

### Issue description

Hi,

While creating a simple RigidBody3D with Area3D, Godot will snap the object with the Area3D collision shape instead of the RigidBody3D collision shape. The behavior happens even if the Area3D collision shape ignore world's collision and mask layer. This can be lead to misplaced object and force the user to place it by hand.

I think the best approach would be that the snap to floor should only use the RigidBody3D's collision shape and ignore every collision that to not collide with the floor.

### Steps to reproduce

- Create a scene with a StaticBody3D as the floor
- Create a new RigidBody3D, create a collision shape.
- Add a Area3D node as the child of the RigidBody3D.
- Add collision shape to the area3d, make it bigger than the rigidbody3d collision shape
- Add the RigidBody3D to the scene and try to snap it to the floor

### Minimal reproduction project (MRP)

[editor-3d-placement-issue.zip](https://github.com/user-attachments/files/22771040/editor-3d-placement-issue.zip)

Contributor guide

Open the contributing guide

Research direction

Start with the attached editor-3d-placement-issue.zip reproduction project and reproduce Snap Object to Floor with a RigidBody3D containing a larger Area3D collision shape. Inspect the 3D editor's Snap Object to Floor entry point and collision-layer handling. Done means the object snaps using only collisions that interact with the floor, rather than the Area3D shape that ignores the relevant layer or mask.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.