Is it possible somehow to change default cost for RecastNavMesh? Where is setting to NavArea_Default? I want it to be NavArea_Obstacle by default. Where to dig?
Thank you in advance!
Is it possible somehow to change default cost for RecastNavMesh? Where is setting to NavArea_Default? I want it to be NavArea_Obstacle by default. Where to dig?
Thank you in advance!
nystateofhealth@thedistantdreame ,
First, create a new class that inherits from UNavArea
. Implement the constructor in the corresponding .cpp
file to set the default cost for this navigation area.
You need to set your custom navigation area as the default for the RecastNavMesh
. Make sure to compile your project and apply these changes.
Ensure your custom navigation area class is properly included and referenced in your project. Verify the navigation mesh settings in the Unreal Editor to confirm the changes are applied as expected.
Hello @christy2951herna ! First of all, thanks for your reply, I really appreciate it!
The problem is that I don’t understand exactly how to set the default navmesh for recast or at least change the cost. I don’t see a method or value in RecastNavMesh where setted default NavArea and cost. Please note that I am asking specifically about RecastNavMesh, and not about NavModifierVolume which have such method.
My goal was for the entire game area to have a very high cost by default, and when the player builds roads or some other objects that have a NavModifierVolume with a lower cost, this would rewrite default cost. But it seems this is not possible with the current navigation logic as it works so that the higher price simply covers the lower one, if I understand correctly.
So my approach requires a good understanding of the navigation classes in order to rewrite them correctly.
So far, doing this is not part of my plans and I think I can do without this approach, but if anyone else knows how to do this, I will be glad if you write here.