Skip to content

Make path CSGPolygon3D dirty when entering tree - #123148

Open
DeeJayLSP wants to merge 1 commit into
godotengine:masterfrom
DeeJayLSP:csg-polygon-should-clean-its-feet
Open

Make path CSGPolygon3D dirty when entering tree#123148
DeeJayLSP wants to merge 1 commit into
godotengine:masterfrom
DeeJayLSP:csg-polygon-should-clean-its-feet

Conversation

@DeeJayLSP

@DeeJayLSP DeeJayLSP commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

If a CSGPolygon3D set to MODE_PATH gets removed from tree, it also gets disconnected from its path to stop updating.

When it is re-added, however, it's never told to re-connect, unless collisions are enabled (in which case CSGShape3D::_notification() will handle it), or we do something to manually make it dirty (like setting it to MODE_PATH again immediately after it re-enters the tree).

The simplest fix I found was to call _make_dirty() when re-entering the tree, specifically for CSGPolygon3D when it's MODE_PATH. The check for collision usage is just to ensure it won't mark it as dirty twice.

Additional information

Reproduction project

Same as the issue, but modified for demonstration: csg_polygon_exit_enter_bug.zip

Before fix

before.mp4

One still works because, as mentioned, it's set to MODE_PATH again which marks it as dirty.

After fix

after.mp4

@DeeJayLSP
DeeJayLSP requested a review from a team as a code owner September 3, 2026 18:43
@Calinou Calinou added this to the 4.x milestone Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSG polygons stop following their set path node when removed and re-added to the scene

2 participants