You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both 2D and 3D use the same NavigationServer with NavigationServer3D being the primary server. The NavigationServer2D is a frontend that converts 2D positions into 3D positions and back.
11
-
Hence it is entirely possible (if not a little cumbersome) to exclusively use the NavigationServer3D API for 2D navigation.
12
-
13
10
Communicating with the NavigationServer
14
11
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
12
@@ -47,34 +44,13 @@ Synchronization for the NavigationServer happens in the middle of the physics fr
47
44
2D and 3D NavigationServer differences
48
45
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49
46
50
-
NavigationServer2D and NavigationServer3D are equivalent in functionality
51
-
for their dimension and both use the same NavigationServer behind the scene.
52
-
53
-
Strictly technical a NavigationServer2D is a myth.
54
-
The NavigationServer2D is a frontend to facilitate conversions of ``Vector2(x, y)`` to
55
-
``Vector3(x, 0.0, z)`` and back for the NavigationServer3D API. 2D uses a flat 3D mesh
56
-
pathfinding and the NavigationServer2D facilitates the conversions.
57
-
When a guide uses just NavigationServer without the 2D or 3D suffix it usually works for both servers
58
-
by exchange ``Vector2(x, y)`` with ``Vector3(x, 0.0, z)`` or reverse.
47
+
NavigationServer2D and NavigationServer3D are equivalent in functionality for their dimension.
59
48
60
49
Technically it is possible to use the tools for creating navigation meshes in one dimension for the other
61
50
dimension, e.g. baking a 2D navigation mesh with the 3D NavigationMesh when using
62
51
flat 3D source geometry or creating 3D flat navigation meshes with the
63
52
polygon outline draw tools of NavigationRegion2D and NavigationPolygons.
64
53
65
-
Any RID created with the NavigationServer2D API works on the NavigationServer3D API
66
-
as well and both 2D and 3D avoidance agents can exist on the same map.
67
-
68
-
.. note::
69
-
Regions created in 2D and 3D will merge their navigation meshes when placed on the same map and merge conditions apply.
70
-
The NavigationServer does not discriminate between NavigationRegion2D and NavigationRegion3D nodes as both are regions on the server.
71
-
By default those nodes register on different navigation maps so this merge can only happen when maps are changed manually e.g. with scripts.
72
-
73
-
Actors with avoidance enabled will avoid both 2D and 3D avoidance agents when placed on the same map.
74
-
75
-
.. warning::
76
-
It is not possible to use NavigationServer2D while disabling 3D on a Godot custom build.
0 commit comments