Edit Baked Navmesh, Splitting Areas, Customising



  • I am using the navigation mesh in a First Person Shooter.  So I need to tweak the cost of different areas on the map. i.e. good cover areas have a lower cost than areas out in the open.  This will encourage the NPC's to move on a more stealthy path, rather than just cutting across an open area.

    Can NavMesh Extension allow me to set navigation areas easily.  To do this, I would need to be able to split areas, so I can make walking close to a wall lower cost less than moving in the middle of the area. I understand I could just split my gameobject up and set the areas on the split object, but then I have to worry about tiling, or laying new colliders on top of the current objects, all very messy.

    I am going to buy your asset anyway, because for $10 it is cheap enough just to use it as a learning tool (Hopefully you aren't using DLL's, so I can check out the code), but it would be nice to know if *Navmesh Extension *can do what I want before I start playing? so I don't have to spend a few hours playing with it to work this out.

    Also, I find that the Unity Navigation Baking is excellant.  I started trying to learn Navigation with Aron Granberg's, A* Pathfinding, but this was complicated, and it didn't do as good a job as unity's built in system.  My 2nd question is, does your asset work with unity's navmesh baking? i.e. I still want unity to auto-generate  off-mesh links for jumps and drop-offs.

    Thx.

    [Edit]
    I bought the asset and love it!!!

    To streamline my workflow, I added a Navigation Area property to the NavMeshObject.  This just saves having to keep the Unity Navigation panel open.

    Just a suggestion, others might enjoy this feature and maybe you could build it into the next version?

    I haven't written editor code before, so my code is embarrassingly bad. But I thought I post it, in case anyone else wants this.

    Module variable in NavMeshObject:

    /// <summary>         /// Navigation area         /// </summary>         [HideInInspector]         public int navigationArea = -1;

    NavMeshObjectEditor:

    Module variable:

    private string[] navAreas;

    Add to OnEnable()
    navAreas = GameObjectUtility.GetNavMeshAreaNames();
     
    Add to OnInspectorGUI() after line DrawDefaultInspector();

    var navMeshObject = target as NavMeshObject;             var _currentArea = navMeshObject.navigationArea;             if (_currentArea == -1)             {                 GameObject go = (GameObject)navMeshObject.gameObject;                 _currentArea = GameObjectUtility.GetNavMeshArea(go);                 navMeshObject.navigationArea = _currentArea;                 EditorUtility.SetDirty(navMeshObject);             }             int newArea = EditorGUILayout.Popup("Navigation Area", navMeshObject.navigationArea, navAreas);             if (_currentArea != newArea)             {                 navMeshObject.navigationArea = newArea;                 GameObject go = (GameObject)navMeshObject.gameObject;                 GameObjectUtility.SetNavMeshArea(go, newArea);                 EditorUtility.SetDirty(navMeshObject);             }



  • I am not sure if I am using this asset for its intended purpose.  But I have Another suggestion...

    If the NavMeshObject's are sitting on top of an existing collider. THen once the NavMesh is baked, then the NavMeshObjects aren't needed for Navigation.  THey can be disabled saving the overhead of having them in the scene.

    I added another Button To the NavMeshManager below "Toggle Renderers", "Toggle NavMeshObjects", to disable the entire object. A couple other tweaks are needed:

    1. Enable objects for baking, then disable after
    2. Enable NavMeshObject for editing, then disable again when exit edit mode.


  • Hey Zaddo, thank you very much for your suggestions.

    I'm still a bit behind replying to all inquiries due to the holidays, but I'll take a closer look at them as soon as possible.


Log in to reply