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 ...
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 NavMesh ...
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
'...
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 is ...
3
votes
How to snap a point to the height of the navmesh surface?
I found the function what does exactly what I need:
...
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 ...
3
votes
How to check if a point is on the navmesh?
I'd find the closest point (NavigationServer3D.map_get_closest_point()) and check the distance between them. If it's on the map, the distance would be approximately ...
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 ...
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.
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.
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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
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 ...
2
votes
Unity how to set Off mesh link speed
You can have an Update or FixedUpdate function check when the agent is on an off-mesh link, and modify its speed in response, as shown here:
...
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....
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 ...
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 ...
2
votes
Accepted
NavMesh going in the ground
make your rigidBody Kinematic as navmesh and navmesh-Agent does not need physics to navigate your agent. make sure you object is grounded and be near of navigation mesh surface.
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/...
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.
...
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 ...
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 ...
2
votes
Dynamically generating and modifying non-Euclidean/Tardis houses while maintaining AI navigability
Since you're working with houses, you can leverage the conventions of those structures to simplify the problem.
To a first approximation, a house is a collection of rooms connected by doorways and ...
2
votes
Accepted
Player overshoots path using NavigationAgent2D and NavigationPolygonInstance in Godot 3.5
I've never used Godot, but just searching the API for NavigationAgent2D turns up this:
float path_desired_distance
Default
1.0
Setter
set_path_desired_distance(value)
Getter
get_path_desired_distance(...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
navmesh × 179unity × 109
path-finding × 66
ai × 29
c# × 26
2d × 11
godot × 9
movement × 8
collision-detection × 6
procedural-generation × 6
unreal-4 × 5
algorithm × 4
vector × 4
optimization × 4
unityscript × 4
godot-4 × 4
rts × 4
collision-avoidance × 4
navmeshsurface × 4
physics × 3
animation × 3
raycasting × 3
unreal × 3
scripting × 3
path × 3