-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You can no longer cut holes in Polygon2Ds. #86242
Comments
As an addendum, when using a Polygon2D specifically, any time you try to create a new area within an already defined Polygon2D in order to cut a hole out, it instead replaces the entire Polygon2D. |
You never could create "holes" with the What changed is the 2D navigation mesh baking with Nested outline support ("holes") was dropped, if you need "holes" add obstructions for the baking process to parse ,e.g. For compatibility the old outlines where kept but if you want the old bake behavior you need to call the deprecated function The documentation was updated to reflect that, although only recently. It has not yet been back ported to the 4.2 release branch so you only see it in the |
Oh I see! Very cool. I was apparently looking at the wrong docs because that wasn't familiar to me, but I now understand how to really use baking. Thank you! For regular Polygon2D's, you may be right. What could I do for this? I have a Polygon2D that basically holds where enemies can spawn, but I don't want them spawning in trees or other such obstacles so I need a way to cut around those. This clearly uses a different technique as no baking is available there, so what do you recommend I do to handle this? |
A real polygon can not have a "hole", so what you basically always do is turn it into 2 or more polygons that are placed around your empty space ("hole"). That is also what the debug rendering does behind the scene when you draw outline paths with the editor tools. |
Closing as there is not bug or regression here and for a "hole" feature with Polygon2D there are (multiple) proposals like godotengine/godot-proposals#9127 open to track it. |
Tested versions
v4.2.1.stable.official [b09f793]
System information
Godot v4.2.1.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.3623) - 12th Gen Intel(R) Core(TM) i9-12900KF (24 Threads)
Issue description
When creating a Polygon2D (including NavigationPolygon2D), you can create a large area and then cut parts of the center out by creating more polygons inside. The documentation also implies this is how it works and indeed is exactly how it worked in 4.1.
In this case, however, what was previously working now seemingly does nothing and is ignored. The cyan area is a NavigationPolygon2D and I cut out an area for the base of the tree. As you can see, the Polygon2D continues into the tree despite this area created.
This is not how it behaved in 4.1.
Steps to reproduce
Explaind above.
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: