godotengine / godotengine/godot

Snap Object to Floor does not work properly with small CSG shapes that have collision enabled

Open
#89,832 2 comments 0 reactions 0 assignees View on GitHub
bug topic:3d topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Found while using 4.3 dev 4.
Reproducible in both 4.2.1-stable and the latest master commit [fe01776](https://github.com/godotengine/godot/commit/fe01776f05b1787b28b4a270d53037a3c25f4ca2)

### System information

Arch Linux

### Issue description

I'm using CSG to prototype scenes that include small objects. While placing these I found that the Snap Object to Floor feature of the 3D editor was moving some of these objects up instead of the intended behaviour of placing them on the object underneath.

After some trial and error with CSG sizes I have discovered that the specific trigger for this behaviour is CSGs that have a Y size of less than 1.0 and have collision enabled.

### Steps to reproduce

This can be reproduced by selecting the CSG Boxes in the example project and pressing Snap Object to Floor. The last two will show the unexpected behaviour.

Before:
![Snap_Before](https://github.com/godotengine/godot/assets/629887/73fb66fe-047c-4d4c-8650-aa7d5e4f2a21)

After:
![Snap_After](https://github.com/godotengine/godot/assets/629887/e2eaea63-6dfe-4909-812d-fabe2cf8668c)

### Minimal reproduction project (MRP)

[SnapObjectToFloor_CSG_Collision_Bug.zip](https://github.com/godotengine/godot/files/14733858/SnapObjectToFloor_CSG_Collision_Bug.zip)

Contributor guide

Open the contributing guide

Research direction

Start by opening the attached SnapObjectToFloor_CSG_Collision_Bug.zip project and reproducing the behavior with the example CSG Boxes. Trace the 3D editor's Snap Object to Floor path together with collision-enabled CSG handling. Done means CSG shapes with a Y size below 1.0 snap downward onto the object underneath rather than moving upward.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.