Hi guys, i wonder if there is a way to make the NavMeshBoundsVolume dynamic?
Main problem: i have created a mini elevator goes up and down, but it seems like the NavMeshBoundsVolume could’t cover the space where the elevator runs.
I have set a NPC standing on an upper floor, and when the mini elevator reaches the floor, it will change the guy’s destination into some location inside the elevator. For the guy, it has a “move to” function to make him run for a specific destination, which will be called when the elevator reaches the floor.
When the elevator reaches the floor, it successfuly changed the guy’s destination and call the “move to” function, but the guy’s just didn’t move at all!
Great question! Yes, you can make it dynamic. There’s a setting in Project Settings under Navigation Mesh to make mesh generation dynamic which will allow you to use moving meshes as part of navigation.
I also highly recommend you read through this document about customizing navigation in general. There are several great examples here detailing how to customize your navigation system to make AI flow smoothly through a level.
Can you elaborate a little bit on what you mean by moving weirdly and differently every time? Also, how big is your nav mesh? AI can behave strangely while the navmesh is being generated; this is something that usually happens during a loading screen in games that use dynamic mesh.
Firstly. sorry about my unclear expression. Let me explain that in detail and graphs:
1. in static mode
i made the NPC move to the sphere target, and the NPC ran directly to it as the red line:
that was what i hoped.
2. in dynamic mode
the NPC has the same target, however this time he kept changing the direction as the red line:
When i showed the Navigation in game, i found that the area in front of the NPC was always red. which i guess meaning un-navigable.
Sorry that i don’t have my laptop which has this project right now, i can’t show you what happen in the game.
Secondly, i created a similar case on the desktop in my office, that problem didn’t happen this time. lol
i guess it was probably be caused by omputer’s performance difference ? (because it is running dynamicly)
Thanks for your help. If this doesn’t make any sense to you, it’s no big problem, i’ll just switch to my desktop.