Questions tagged [navmesh]

A navigation mesh is a data structure used by pathfinding algorithms to help AI agents move around complicated spaces. Navmeshes describe what part of level geometry agents are allowed to access (e.g. floors, platforms) while taking user-defined parameters and obstacles into account (floor steepness, step height, static objects).

Filter by
Sorted by
Tagged with
1 vote
0 answers
19 views

Procedural NavigationPolygon for a platformer in Godot 4

I'm trying to make navigation possible for npcs in a 2D platformer. The game generates chunks with random platforms as the player ascends, so I also need to implement the navigation procedurally. Each ...
Alex CB's user avatar
  • 366
0 votes
2 answers
45 views

How to rotate NavMeshAgent toward its movement direction?

I'm working on a 2D game in XY plane. I've created enemies using NavMeshAgent and I've gave my agents way pints to move between them. The problem is that I don't know how to rotate them in the ...
A-Eye's user avatar
  • 3
1 vote
1 answer
111 views

Generate a fully 3D NavigationRegion/pathfinding in Godot 4

I'm making a spaceship game where the enemies and the player have the full 6 degrees of freedom, so can move forward/backwards, left/right, up/down and can also rotate in all three axes. I'm wanting ...
beyarkay's user avatar
  • 127
0 votes
0 answers
34 views

How to apply avoidance to path following with root motion?

My Character Blueprint uses Root Motion to control locomotion (taking location and turning it into a direction to move). However, root motion is not compatible with avoidance pathfinding such as ...
Candle's user avatar
  • 141
0 votes
0 answers
38 views

Scared enemies run into walls

I set up a basic pyramid shaped enemy kinematic body that runs away from the player when its health is too low and runs towards the player if the enemy has enough health. The enemy also turns to face ...
Cei's user avatar
  • 863
1 vote
1 answer
110 views

Rectangular shape NavMeshAgent for Unity?

I have an issue with the tank character. The Unity's navmesh agent only has a cylinder shape, so when the enemies are nearby, it causes unwanted results. If the navmesh is too big(to cover the entire ...
modernator's user avatar
  • 1,183
0 votes
1 answer
60 views

Mouse-Click Movement Using Unity NavMeshAgent Causes Stuttering Upon Reaching Destination

Alrighty, so I've seen a lot of stuttering-related questions about NavMeshAgents but my problem is a little specific to my use case since it has nothing to do with <...
NicCantCode's user avatar
1 vote
1 answer
417 views

How to deal with large number of Navmesh Agents?

I have more than 200 units in a single scene, all of them use Unity's NavmeshAgent to set their destinations to the main target. The problem I'm facing is that some ...
jasmine zhao's user avatar
0 votes
1 answer
109 views

Vertical components not working with NavMeshAgent .move or .velocity?

This is a weird one. I'm using a 2d adaptation of the NavMesh (found here: https://github.com/h8man/NavMeshPlus) to get obstacle avoidance for my AI in my 2d game. I also want to use it for my player ...
IronWaffleMan's user avatar
0 votes
0 answers
114 views

How to follow a moving target using Godot NavigationAgent2D?

I am currently creating an enemy which will follow the player. I was using the player GlobalPosition to calculate the direction of the enemy movement. I am now in the process of implementing obstacles ...
Zeruno's user avatar
  • 101
2 votes
1 answer
801 views

How to make a Unity navmesh agent keep distance from the target

I want my enemies to follow the player, stop at a certain distance and when enemy is within that distance he will walk away. ...
Foneet's user avatar
  • 31
0 votes
2 answers
110 views

Weighting navigation mesh nodes for A*

I'm trying to implement path finding for my game using a navigation mesh and A* search. While I believe I got this working correctly I'm having trouble getting desired results because I don't know how ...
user1566228's user avatar
0 votes
1 answer
555 views

How to stop NavMeshAgent resetting rotation

I'm prototyping a 2.5D style game. I have my sprites angled at a 33° angle on the x axis. I'm using the NavMeshAgent for basic navigation and pathfinding. I've set the Angular Speed to 0, to prevent ...
Adam Lobo's user avatar
  • 299
0 votes
0 answers
115 views

NavigationAgent moving outside of NavigationRegion3D and `cell_size` error

I am having quite a time getting navigation to work within a GridMap. Here is the project So here is how I've approached things. I created a few tiles in blender ...
Matthew Goulart's user avatar
0 votes
1 answer
1k views

Creating a nav mesh

I'm coding a custom engine using Python and Pygame. It's a top down 2D isometric RTS and I wan't to implement pathfinding for my units. My research has lead me to using a Navigation mesh which seems ...
Zoler1337's user avatar
0 votes
1 answer
2k views

RuntimeNavMeshBuilder: Source mesh does not allow read access

My code generates a level by looping through a list of empty game objects and choosing a random object from another list of objects, then instantiating that object at the empty object's position. Then ...
Crystalline787's user avatar
1 vote
0 answers
152 views

Issues with Unity NavMesh Links During Runtime

I'm pretty new to gamedev, so please bear with me. So the end goal here is to have some platforms that spawn in, and the player has to stay on the platforms to stay alive, while an enemy roams the ...
Braeden Corr's user avatar
0 votes
1 answer
55 views

Navmesh agents trying to go to destroyed objects

I am still working on the RTS and have added a system that allows enemies to randomly wander. However, when multiple enemies fight one of my units, they will just clump up Afterwords instead of going ...
Crystalline787's user avatar
1 vote
1 answer
1k views

Check if point is within Unity NavMeshSurface walkable area

I am using the NavMeshSurface component in Unity to generate a navmesh of walkable areas in a procedurally generated level. I am working on some basic behavior to use with a NavMeshAgent. I want to ...
GaleRazorwind's user avatar
0 votes
1 answer
342 views

Player overshoots path using NavigationAgent2D and NavigationPolygonInstance in Godot 3.5

I'm trying to add a click to move feature in my game using the new NavigationAgent2D and NavigationPolygonInstance but sometimes when the player reaches the end of the navigation path or changes ...
Javier Villanueva's user avatar
1 vote
2 answers
92 views

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

General Description I want to build a tech demo about a game concept I am carrying around for quite some time now. A lot of influences from different sources shaped this, and I will try to hint on its ...
Confused Merlin's user avatar
2 votes
0 answers
268 views

What's the best strategy for incorporating jumps into a 3D AI navigation algorithm?

I'm trying to make a game centered around chase sequences in a 3D level with a high degree of verticality and movement options for the player. Basically think Breath of the Wild in an urban landscape ...
Austin Capobianco's user avatar
0 votes
0 answers
206 views

How can I pragmatically move a navmesh rigid body when changing scenes?

I have an object with both rigid body and NavMeshAgent attached Which I want to set to a new location on scene change, but there is something weird going on with it. If I just try to set the position ...
Michael's user avatar
  • 101
0 votes
1 answer
154 views

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

I've read a couple of articles on Navmesh+A* navigation. So, I'm trying to implement a pathfinding for an RTS type of game. However, it seems I don't understand how to calculate a distance for A* when ...
Dmitrii Naumov's user avatar
0 votes
0 answers
1k views

How can I force my Navmesh agent to only move four directions? (for 2D)

I'm making a 2D game in Unity. For 2D I am using the NavmeshSurface2D-plus master package available on github. My enemy object is chasing my main character nicely, it's ok. I set my main character to ...
gunza's user avatar
  • 13
0 votes
1 answer
510 views

How can I update the Navmesh path in 2D games?

There are destructible and indestructible objects on the map I created with Tilemap, and I create a walkable area (bake) for my enemy object using the information I found on the internet and the ...
gunza's user avatar
  • 13
1 vote
1 answer
230 views

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

I'm making generator for EQS and need to put points on navmeshes located on different heights, one above other. So, my idea is to make raycast vertically and find intersection points with navmeshes. ...
Robotex's user avatar
  • 251
1 vote
1 answer
530 views

Godot bake NavMesh not working

I have a layout similar to the official Godot NavMesh example program. It is: ...
TheWorldSpins's user avatar
0 votes
1 answer
206 views

desired velocity and the local space z axis

This question is related to my previous post here , but, even though I did get some insight, I didn't fully get it, and hence have another dilemma. Since the dead earth series is not publicly ...
BumbleBee's user avatar
0 votes
1 answer
390 views

confusion on desired velocity

In one of the videos of the dead earth game dev series , the author mentions of calculating a local desired velocity of a NavMeshAgent. My point of confusion was, ...
BumbleBee's user avatar
0 votes
1 answer
143 views

Check if a procedurally generated maze built out of cubes is solvable

I have created a procedural level generator in unity. However, occasionally the algorithm creates a level that is impossible to solve. Therefore, I tried to implement a navmesh agent to check if it is ...
Dpythonrobot's user avatar
1 vote
0 answers
65 views

Object does not follow path correctly

I am trying to have an object follow a path which basically is a square: the object moves to the next corner and pauses for some time. The movement is correct initially, however, after sometime it ...
Minoush82's user avatar
0 votes
0 answers
332 views

Is there built-in way to restrict a `NavMeshAgent` to a specific area on a`NavMesh`?

I have an object with a NavMeshAgent that wanders around. It gets a random waypoint, moves to it, then waits a little while and repeats this process. I would like ...
Hazel へいぜる's user avatar
0 votes
0 answers
1k views

Character controller versus nav mesh agent for wandering?

I'm starting to work on the AI for my game, and one character will need to wander around aimlessly until one of its other states are triggered. With that, and after plenty of searching, I found a ...
Hazel へいぜる's user avatar
0 votes
0 answers
448 views

how to create something similar to warcraft 3 local avoidance?

I want to write a script that can lead to something like https://gyazo.com/90d3a0ec82a41f53c831b00c403dc7df (to surround the enemy through local avoidance). i am using navmesh unity, to solve this ...
NerzOff's user avatar
0 votes
0 answers
922 views

Companion AI with NavMeshAgent causing jittery movement on the X-Axis

I'm trying to do a companion AI that follows around my player but with a certain distance. I first tried to self-program the movement behavior. but realized quickly that a ...
Junes's user avatar
  • 11
1 vote
1 answer
99 views

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

Why do solutions such as Recast voxelize a 3D scene before transforming it back into polygons? Would it not be possible to just determine intersections of meshes, check for slope angles and adjust ...
xcrypt's user avatar
  • 478
0 votes
0 answers
386 views

How to generate a navmesh from a set of 3D meshes from scratch

I've found a great article on how to build a constrained delaunay triangulation that can be used to create a simple navmesh from cutout geometry. However, this does not seem sufficient to generate a ...
xcrypt's user avatar
  • 478
0 votes
0 answers
911 views

How can I get a raycast to hit navmesh only?

In Unity, I'm trying to get the raycast to hit the navmesh only, but I cannot find an option to place navmesh on a specific layer. Is there a way to raycast to the navmesh itself?
Leo Blanchette's user avatar
0 votes
1 answer
247 views

Unity Nav mesh lading data each frame

Hey all I had a question, I was looking into my game's performance and noticed this in the profiler: Is there any way to optimize this such as pre-generating tiles so it doesn't have to do it each ...
Doug Ray's user avatar
  • 143
1 vote
0 answers
985 views

Going up and down stairs by Unity3d's NavMesh

*Purpose I want to create a navigation mesh that is optimized for going up and down stairs and stopping. *Question I'm making a nav mesh to make a character go up and down stairs. I'm making a nav ...
user3732298's user avatar
4 votes
0 answers
115 views

Navigating an AI that shouldn't take the shortest path but the scenic route instead (e.g. fish)

I'm working on a sidescrolling game with an underwater "fish-like" AI that has some goals (interacting at various locations) and things to avoid (player). Started of with a Navmesh and ...
Paprik's user avatar
  • 151
0 votes
1 answer
60 views

How to assign an index to different node clusters? (for pathfinding)

Hellow~ So for a bit of context: i'm currently working on a RTS (way above may league) which already has a level editor and a node grid which maps the terrain, i previously make a navigation system ...
Frame Matt's user avatar
0 votes
1 answer
1k views

Nav Mesh Agents are not moving along the mesh

I'm fairly new to unity.I've been playing with Nav Mesh Agents lately.I have encountered this problem twice.The first time I didn't bother redoing my project all over again.But now its bothering me ...
AfiJaabb's user avatar
  • 113
0 votes
2 answers
3k views

Check if NavMeshAgent can reach position with dynamic obstacles

I am currently checking if a position in the NavMesh is reachable. It is reachable without the NavMesh obstacles. But the moment I add it, NavMesh's CalculatePath() ...
CraftedGaming's user avatar
1 vote
0 answers
88 views

How to adjust a path to avoid collisions with moving obstacles inside a nav mesh?

I'm writing a script for a bot and I'm a little bit stuck. There's a game, there's a player (me) and I want to get from point A to point B. I can find the path via bot's API (it returns a ...
FelisManulus's user avatar
0 votes
2 answers
164 views

Is collision detection with static environment necessary for npcs

I can't find any information on this topic. I'm wondering about the differences between the collision detection approach for player as opposed to npcs. Basically NPCs will move strictly along the ...
user avatar
2 votes
0 answers
116 views

Any good pathfinding algorithm for lots of different speed zones? NavMesh seems not work

I have a terrain map with lots of different areas: roads, grass, swamp, forest, mountains. Each has different speed for the player. The map is continuous 3D map, not grids. Given a start & end ...
IlIlijl1Ili's user avatar
0 votes
0 answers
699 views

Implement navmesh for climbing cliffs and walls

I am trying to implement dynamic wall climbing similar to Conan exiles and Legend of Zelda: Breath of the Wild. My system as of now uses a raycast to get the direction of a geometry's normal, and I ...
Bobby B's user avatar
  • 21
1 vote
0 answers
502 views

NavMeshAgent.CalculatePath produces a PathInvalid result

Anyone know what can cause NavMeshAgent.CalculatePath to return false and give a path with PathInvalid status? I have two ...
Mason Wheeler's user avatar