This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
默认的 3D edge_connection_margin 可以在 ProjectSettings 的 navigation/3d/default_edge_connection_margin 中修改。
任何导览地图的边缘联机边距值也可以在执行时使用NavigationServer API进行变更。
extendsNode2Dfunc_ready()->void:# 2D margins are designed to work with 2D "pixel" values.vardefault_map_rid:RID=get_world_2d().get_navigation_map()NavigationServer2D.map_set_edge_connection_margin(default_map_rid,50.0)
usingGodot;publicpartialclassMyNode2D:Node2D{publicoverridevoid_Ready(){// 2D margins are designed to work with 2D "pixel" values.RiddefaultMapRid=GetWorld2D().NavigationMap;NavigationServer2D.MapSetEdgeConnectionMargin(defaultMapRid,50.0f);}}
extendsNode3Dfunc_ready()->void:# 3D margins are designed to work with 3D world unit values.vardefault_map_rid:RID=get_world_3d().get_navigation_map()NavigationServer3D.map_set_edge_connection_margin(default_map_rid,0.5)
usingGodot;publicpartialclassMyNode3D:Node3D{publicoverridevoid_Ready(){// 3D margins are designed to work with 3D world unit values.RiddefaultMapRid=GetWorld3D().NavigationMap;NavigationServer3D.MapSetEdgeConnectionMargin(defaultMapRid,0.5f);}}