13 votes

Is it possible to use nav-mesh in 2d game in Unity?

In case anyone Googles this later, you CAN use nav meshes in Unity. I'm using unity 2018.2 and set up a navmesh in a purely 2D top down tilemap game I'm working on. Check this thread in the Unity ...
Chris Langtiw's user avatar
8 votes
Accepted

What is best method for 2D pathfinding in procedural world?

As you shall see, the spirit of this answer is that, in game programming, there is rarely a dead-on answer like A is always better than B. But let's dive a bit more into the details. So my main ...
MAnd's user avatar
  • 4,887
5 votes
Accepted

What does NavMesh.AllAreas specify in Unity?

TL;DR NavMesh.AllAreas let you compute a path considering all the NavMesh Areas are walkable for your agent. Long answer Areas and costs When you build a ...
Hellium's user avatar
  • 2,949
5 votes
Accepted

Is it possible to use nav-mesh in 2d game in Unity?

You cannot use the Unity Navmesh in 2D, you would have to write your own. As far as I know, there are no free nav mesh tools available. Alternatively, you could use a Nodal Pathfinding approach, as ...
jgallant's user avatar
  • 8,414
5 votes

How does heavily constrained delaunay triangulation work?

You're almost there. Once you have a delaunay triangulation of all the points (including constraint points) then: foreach constraint edge: Find all existing intersecting edges in the triangulation '...
jdtec's user avatar
  • 94
4 votes
Accepted

Unity Vector3 position inside collider

Use Collider.ClosestPoint(Vector3 position). From the documentation: Returns a point on the collider that is closest to a given location. Update: Sadly this ...
Tom Tsagkatos's user avatar
3 votes

Infinite plane with Unity Navmesh agent

From my understanding the Unity NavMesh has to be baked so it's not something you can do in real-time. My advice would be to go and build your own path finding solution using the A* algorithm or ...
Yatoniea's user avatar
  • 181
3 votes
Accepted

NavMeshAgent in unity not working

You need to bake a navmesh first.
Draco18s no longer trusts SE's user avatar
3 votes

Is it possible to use nav-mesh in 2d game in Unity?

As already answered the navmesh does not work in 2D, but you can fake it by creating a 3D scene with just colliders, set an orthographic camera from above and attaching sprites to the 3D objects.
Tithian's user avatar
  • 104
3 votes

How to snap a point to the height of the navmesh surface?

I found the function what does exactly what I need: ...
Robotex's user avatar
  • 251
3 votes
Accepted

Creating a nav mesh

TLDR: Which option to use depends on the need. Grid-based maps use navmesh will have additional workload, but the effect is better in most cases. Navmesh is essentially an optimization of a grid-based ...
Mangata's user avatar
  • 2,516
3 votes

Funnel algorithm : not possible with all convex polygons?

Edit : After further testing, I found out that a special case of this kind is also needed for triangles in some cases. I probably just incorrectly understood the algorithm ? Maybe it's because this ...
DisturbedBerry's user avatar
2 votes

Is it possible to use nav-mesh in 2d game in Unity?

Bake the Navmesh onto your scene (xz) and emit all things to 2D (xy). ref: Navmesh2D concept
dDiapers's user avatar
2 votes

UE4 Navmesh precision

A Navmesh is generated according to so-called "Nav Agents". These Nav Agents are located in your Project Settings under the "Navigation System" Settings. There you can create a new Agent or edit ...
Raildex's user avatar
  • 761
2 votes
Accepted

Enemies are penetrating in each other when following player

To avoid penetration, increase each NavMeshAgent's radius so it's equal to or larger than your agent's collider.
Chris McFarland's user avatar
2 votes

Why are multiple Nav Mesh Agents jittery when the target is inaccessible?

I had this problem and I was messing around with the Nav Mesh Agent and found out turning off "Auto Braking" fixed the problem.
Dez Boyle's user avatar
2 votes

Infinite plane with Unity Navmesh agent

I know it's quite old one, but you should be able to achieve this with NavMesh Surface It's official created by Unity, but it's not part of Unity though as of now - check that link for how to install ...
R1cky's user avatar
  • 131
2 votes

How to implement jump in NavMesh?

Why it is not working As you said, the function is called as soon as you hit Space. That's why it doesn't work because isKinematic is then instantly reset to ...
Shashimee's user avatar
  • 1,250
2 votes

Visualizing NavMesh to Camera

Just want to add to the answer above, if your NavMesh consists of different Areas, you can actually assign your triangle indices to different submeshes using ...
John Doe's user avatar
  • 121
2 votes
Accepted

Visualizing NavMesh to Camera

This should be possible by optaining the triangles from the generated NavMesh. So first you need to bake the NavMesh and then call CalculateTriangulation. This gives you a NavMeshTriangulation object ...
Tim Rolff's user avatar
2 votes
Accepted

Unity using different NaveMesh for the same position

I'd try to work around this using additive scene loading. Create three different copies of your scene file. In each one, bake a navmesh for one corresponding version of your environment. Then delete ...
DMGregory's user avatar
  • 134k
2 votes

How to move NavMesh Agent by animation?

You need to attach this animation to your player gameobject and in code (the third person controller does this as an example) set a variable whenever it's moving and send it to the animator. Then in ...
Ethan The Brave's user avatar
2 votes

Unity navmeshagent and doors

I think what you're looking for is the NavMeshObstacle component. https://docs.unity3d.com/Manual/class-NavMeshObstacle.html https://docs.unity3d.com/ScriptReference/AI.NavMeshObstacle.html
akkwake's user avatar
  • 81
2 votes

Stop character from moving after reach his destination?

You can use a constrain on the rigidbody https://docs.unity3d.com/ScriptReference/Rigidbody-constraints.html Or if the external force is a physic-related one make it cinematic. https://docs.unity3d....
Adrian Sgro's user avatar
2 votes

Stop character from moving after reach his destination?

Could you just set isKinematic on the RigidBody to false once he reaches the destination? This would prevent the rigidbody from being effected by physics, which is kind of like preventing any force in ...
Zachary Sheppard's user avatar
2 votes

In unity, making a navmesh for a tiny planet?

Here is a thread on doing just what you're asking about: https://forum.unity.com/threads/new-navmesh-how-to-create-rotated-localnavmeshbuilder-solved.476489/ This might require you to break your ...
Calcidius's user avatar
2 votes
Accepted

How to find a valid point if NavMeshObstacle is blocking path?

NavMesh.CalculatePath does return you a partial path if it cannot reach the destination. You can try reading the last corner of the path that you get returned. Source: https://docs.unity3d.com/...
Whitecold's user avatar
  • 188
2 votes

Why does a 3D scene need to be voxelized before it can be transformed into a navmesh?

DMGregory's point about voxelization's simplicity seems about right. Another reason though, is performance. With these navmesh algorithims, you need a way to reduce the complexity of a scene. ...
Charly's user avatar
  • 742
2 votes

How to calculate distance for A* when searching a path on navmesh?

When you say you want to calculate the "distance for A*", you mean the heuristic, right? The heuristic is an estimate of the distance. And you want to avoid overestimating it. See Admissible ...
Theraot's user avatar
  • 26.6k
2 votes

Dynamically generating and modifying non-Euclidean/Tardis houses while maintaining AI navigability

Non-euclidean space is actually not as much of a problem for route finding as you would believe. The reason is that most standard route finding algorithms (A* included) do not operate on a grid but on ...
Philipp's user avatar
  • 119k

Only top scored, non community-wiki answers of a minimum length are eligible