I updated my project to Godot 4.2, now it says the MakePolygonsFromOutlines is depreceated, what do i use know? i tryed use the NavigationServer2D.BakeFromSourceGeometryData and NavigationServer2D.ParseSourceGeometryData but i dont know if i need use both or when use both, it also broke my pathfind system.
You can still use the deprecated function. The main reason the function still exists is so older projects that rely on the old outline bake behavior can finish what they started.
Switching to the new baking might not always be possible with old scenes when they had NavigationPolygon with nested, inner outlines all stacked in the same polygon resource. You can the updated documentation for the new 2D navigation mesh baking here: Using navigation meshes — Godot Engine (latest) documentation in English
Well on my scene its possible, iam making a game like Clash Royale, so i make a big isometric Square around the map with navigation polygon, but for some reason when i switch to bake the area be smaller and be on wrong position, idk why
The NavigationPolygon has by default an agent radius of 10 pixel to match the NavigationAgent2D radius. That agent radius shrinks the polygon surface when baking. This offset is done because when navigation mesh and physics collision align without margin agents get stuck, especially at corners. If you don’t need or want the offset set the agent radius to zero.
I don’t understand how I can do navigation for a complex map for RTS. Tilemap is created at the start of the game based on a map file that can be made in the editor. Cells with obstacles are marked as “physical”. The problem is that if you add a navigation polygon to the created map and bake it, then you get a non-working navigation. See the video. Polygons intersect and refract. Units don’t always walk in a straight line.
I wanted to assemble a common navigation polygon from individual polygons for each Tilemap cell. But I can’t figure out how to do it… I see that it is possible to create a polygon as a collection of points. But then how do I carve out a place for objects like “tree” or “building” in real time?
If I do as in the example above, then the units do not move.