godotengine / godotengine/godot

ShapeCast3D against Shape with backface occasionally reports wrong normal

Open
#119,006 0 comments 1 reaction 0 assignees View on GitHub
bug needs testing topic:3d topic:physics
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.7.dev4.official [755fa449c]

### System information

Operating System: Manjaro Linux KDE Plasma Version: 6.5.6 KDE Frameworks Version: 6.24.0 Qt Version: 6.10.2 Kernel Version: 6.18.18-1-MANJARO (64-bit) Graphics Platform: Wayland Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor Memory: 128 GiB of RAM (125,7 GiB usable) Graphics Processor: AMD Radeon RX 7900 XT Manufacturer: Gigabyte Technology Co., Ltd. Product Name: B550 AORUS ELITE AX V2

### Issue description

At very rare occasions, a ShapeCast3D that sweeps against a Trimesh with backface enabled, will report the wrong normal

### Steps to reproduce

I can't tell how to reproduce this, as this occurs randomly.
I have attached a MRP with an oscillating ShapeCast3D that uses DebugDraw addon to draw the normals/points. in irregular occasions, it will draw the normal of the floor backface and not the intended wall one

### Minimal reproduction project (MRP)

[shapecast3d_mrp_2026-04-27_20-18-10.zip](https://github.com/user-attachments/files/27137250/shapecast3d_mrp_2026-04-27_20-18-10.zip)

test.tscn contains a correct example.
test2.tscn contains an example where it reports an incorrect normal randomly (although mostly in the right side of the oscillation)

Contributor guide

Open the contributing guide

Research direction

Open the attached reproduction project and compare test.tscn with test2.tscn, then run test2.tscn while observing the ShapeCast3D normals and the oscillation. Confirm whether the incorrect floor-backface normal can be reproduced reliably before locating the relevant Godot 3D collision code. Done means identifying a reproducible failure and verifying that the reported normal consistently matches the contacted wall.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.