Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

NavMesh Extension (NavMesh Drawing & Portals)

Discussion in 'Assets and Asset Store' started by Baroni, Apr 12, 2014.

  1. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi nogaskater,
    the baking process takes all objects into account which are marked as (navigation) static in the layer settings. Please check that the terrain object is not on this layer for it to be excluded.
     
  2. nogaskater

    nogaskater

    Joined:
    Apr 25, 2015
    Posts:
    5
  3. Tomredfog

    Tomredfog

    Joined:
    Apr 24, 2013
    Posts:
    2
    Hi!
    I buy NavMesh, I have unity 5 in personnal edition, and... it don't work.
    All is okay in exemple scene, but when i click on "Edit Mode" button and try to place a vertices in my scene, nothing appears...
    So i try it on a new projet/new scene : same think.
    :'(
    Can you help me Baroni?

    Thanks!
    (sorry for my english ^^ )
     
  4. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi, thanks for contacting me.
    Do you place vertices on a collider? It can only detect clicks on "hard surfaces", with colliders.
     
  5. Tomredfog

    Tomredfog

    Joined:
    Apr 24, 2013
    Posts:
    2
    Oh... my bad.
    I have a collider... on a plane... import to 3ds max...
    :D
    Thank a lot for this very fast reply! It's perfect now on box with collider!
     
  6. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
  7. Zorranco

    Zorranco

    Joined:
    Jul 15, 2014
    Posts:
    23
    Seems like demo scene doesn't work in Unity 5...
     
    Last edited: Jul 13, 2015
  8. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    It has been successfully tested against Unity 5.0. Which Unity version are you using and what does "doesn't work" mean?
     
  9. Zorranco

    Zorranco

    Joined:
    Jul 15, 2014
    Posts:
    23
    5.0.2.f1

    Ok, don't worry, I didn't noticed console saying "Navmesh agent format has changed, please rebake"

    Once you rebake, everything works fine, thanks.
     
  10. myibmaccount

    myibmaccount

    Joined:
    Nov 10, 2012
    Posts:
    12
    Hello Baroni.

    I am really interested in the Portals Feature. However, I am having some trouble getting it to work.
    1. I have used the Portal Manager to place one portal In my scene.
    2. I have place to separate nav meshes on my scene. The first portal is on one navmesh and the second is on the other.

    When I have the nav agent move to a waypoint located on the second navmesh the nav gets stuck at the edge of the first navmesh. Do the "portal nodes" need to have a Collider Component added to them or something?

    thx.
     
  11. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi there,
    no, colliders are not necessary. Do you use the AgentController script of the sample scene - which builds the path using PortalManager.GetPath - or how do you pass the path to the agent?
     
    myibmaccount likes this.
  12. myibmaccount

    myibmaccount

    Joined:
    Nov 10, 2012
    Posts:
    12
    Thanks for quick reply. I guess I am probably not going about things in recommended way. I have done the following:

    1. Add the NavAgent to my game character.
    2. I added a simple script to the player (via add component, and select script component) that will have her move to a specified point:

    void updateMoveToTarget(GameObject trgt) {

    Debug.Log ("Selected Object is: " + trgt);
    if (trgt != null) {
    gameObject.GetComponent<NavMeshAgent> ().SetDestination (trgt.transform.position);
    } else {
    gameObject.GetComponent<NavMeshAgent> ().SetDestination (gameObject.transform.position);
    }

    }

    3. Created my navmesh using your manager (very intuitive design btw) and baked it.

    This got me to the point of having my character move around the screen towards whatever target is placed in the updateMoveToTarget() method.

    Then I thought "oh that is neat so let's play with portals." Never got that going, but from your statement I think I need to review your sample code.

    thx.
     
  13. myibmaccount

    myibmaccount

    Joined:
    Nov 10, 2012
    Posts:
    12
    ok reviewed your AgentController code. Good example (sorry for not checking that first). I will implement that process, and let you know.
     
    Baroni likes this.
  14. myibmaccount

    myibmaccount

    Joined:
    Nov 10, 2012
    Posts:
    12
    Hi Baroni.

    I just wanted to followup with working portal example:


    thx
     
    Baroni likes this.
  15. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
  16. myibmaccount

    myibmaccount

    Joined:
    Nov 10, 2012
    Posts:
    12
    Oops. LOL. Just set it to public.
     
  17. Bralgs

    Bralgs

    Joined:
    Mar 1, 2013
    Posts:
    3
    Hi Baroni,
    I'm about to buy this great asset, but first I have to know, if it's possible to instantiate and use these nav meshes at runtime? If yes, will the transition between these generated meshes work well? Does offmesh link from unity work on these nav meshes?
    Thanks in advance for your awnser, und viele Grüsse aus deinem Nachbarland Schweiz! ;)
     
    Last edited: Sep 25, 2015
  18. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @Bralgs, unfortunately not. If I may quote a question on the first page of this thread:
    Grüsse zurück!
     
  19. CYBERDISCOVERY

    CYBERDISCOVERY

    Joined:
    Oct 6, 2015
    Posts:
    1
    Can i set the navmeshes areas and cost?
     
  20. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Yes, this asset does not customize Unity's NavMesh settings so you can use them like before.
     
  21. markskelton

    markskelton

    Joined:
    Dec 29, 2015
    Posts:
    3
    Hi Baroni,

    I've just purchased this extension and I'm having a problem were vertices are being placed above the ground when I want them to be placed exactly on the ground. Would you know how to solve this problem and is there a tutorial on how to use this extension?

    Thanks,

    Mark
     
  22. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @markskelton,

    have you had a chance to look at the timelapse video on our Asset Store page yet? On the NavMesh Object component (where you enter and leave the edit mode) you can specify an Y offset value, or set it to zero. By default, vertices are placed on the collider you've clicked on + the additional height you've specified for the y offset. So make sure that your colliders are fitting the ground perfectly too.
     
    markskelton likes this.
  23. markskelton

    markskelton

    Joined:
    Dec 29, 2015
    Posts:
    3
    Thanks for the quick response! That's fixed it now. A short video with a voice over on how to use the basic features of your plugin would be brilliant, but it's understandable if you don't have time to do this.
     
  24. Noeinz

    Noeinz

    Joined:
    Jun 1, 2013
    Posts:
    14
    Hello Baroni,
    Is there a way for the navagent not to stagger everytime i click somewhere to move. Right now if i click a forward direction the player starts walking, if i click a destination slightly ahead or same direction, the player slows down or staggers before going to the next destination. Can you tell me where should i update the code so it doesn't loose it's walk speed and just keeps walking?
     
  25. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @Noeinz,

    this is the default NavMeshAgent behavior, not something controlled by my code. Have you tried setting auto braking to false in the navmesh agent inspector?
     
  26. DamonJager

    DamonJager

    Joined:
    Jul 16, 2015
    Posts:
    56
    so this uses the native navmesh builder
     
  27. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Yes.
     
  28. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Are you guys still supporting this product?
    I tried to reach you on Facebook and Twitter but got no response.
    Im having a real hard time making it do anything useful with a terrain shaped mesh.
    Most of the time it will place random points in the air, and other times it just leaves huge gaps in the nav meshes.
     
  29. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    @JohnRossitter Yes, I do - there was an update not too long ago. We don't have a public Facebook page/account, I wonder who you've tried to contact :)

    Could you please send a small repro with the terrain via email so I can take a look (email is stated on our website and in the documentation PDF).
     
    JohnRossitter likes this.
  30. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    I just bought it 3 days ago, so unless your update was in the last 3 days, I think I have the latest version
     
  31. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    @JohnRossitter Still, I would need a sample scene / repro / mesh to investigate the issue.
     
    JohnRossitter likes this.
  32. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Well, I have 12 gigs of project, perhaps you can TeamView and look
     
  33. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    With all due respect, I can't take a look at something and then do a fix afterwards without any chance to reproduce it again under the same conditions. You're an Asset Store publisher yourself, you know how this works. There has to be some effort put on both sides. Your mesh possibly isn't 12 gigs.
     
  34. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Wow, thats a bit harsh.

    The issue is that the tool is selecting vertex locations that are not on my mesh, so to replicate the issue I would need to let you test it in the same environment that it is happening in.
    As a publisher yourself, you should revel in the opportunity to have remote access to another development machine so you can see first hand what issues are happening as well as have the tools to diagnose and possibly fix said issues.

    If you just dont want to help, thats cool Ill find another tool
     
  35. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    I would like to help - as always. I'm here asking for a reliable way to reproduce your issue on my end after all. I just don't want to access your machine because it's (a) a time consuming task for both of us and (b) not something that seems to be easily fixed just by looking at it. I need a way to reproduce this so I can work on it. If you can't send me the mesh, how should I be able to fix it? I don't want to modify things in your project either.
     
  36. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    It doesn't matter, Ill just make the nav mesh data in Maya.
     
  37. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    hey there, just a couple of questions i have...

    Regarding this package, is the option possible where you could bake different geometry to a specific NavMesh area? (e.g. land area: cost 3, underwater: cost 4) Also, could i use this tool to create mesh ontop of a terrain? (to set rivers or underwater places)

    thanks :)
     
    Last edited: Apr 12, 2017
  38. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @KIR99,

    thanks for your interest!

    - Yes, each mesh group you create is separate game object you can assign to different navmesh areas. In Unity 5.6, this can be done via the NavMeshModifier component attached on the mesh.
    - Currently the mesh creation does not work well with terrains. I mean, you can create meshes on top of terrains, but they will still be flat and won't follow the surface shape closely. This would require something like a deformation feature, to bend the mesh to fit the terrain shape.
     
  39. Antragon

    Antragon

    Joined:
    Jun 9, 2015
    Posts:
    4
    Greetings!

    Please consider this as feedback to the developer and a little advice for people that stumble across the same problem as me.

    Irecently bought this tool since manually drawing a NavMesh is a very cool thing to do. However, I found that deleting Vertices of the created mesh is rather bugged for me: Lets say I want to delete the vertex indicated by the arrow on "NavMesh1" which didn't connect due to a misclick by myself. I delete it and "NavMesh2" happens. This can be a real pain if you have a rather large NavMesh and you want to delete one single vertex - you have to create the mesh all over again or keep an unclean Mesh.

    It took me a while, but I finally found out that creating triangles rather than rectangles is to way to go ("NavMesh3-5").
    Maybe this could be somehow mentioned in the Quick Start Guide?

    Except for that, now it works like a charm and I'm very glad I found this product.
     

    Attached Files:

  40. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @Antragon and thanks for the screenshots! Although each quad is basically a triangle (or two, technically), the behavior you've described in NavMesh1-2 should definitely never happen. I'll try to reproduce that on my end, thanks again for the bug report!
     
  41. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    855
    I am working on generating procedural landscapes (terrains) with object spawning at runtime. Would this asset help me to dynamically create navmeshs on the terrain?
     
  42. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @StevenPicard, please see this post for a related answer. Runtime NavMesh baking is supported by default using Unity's new navigation tools introduced for Unity 5.6 (but available on GitHub as a separate download). This asset let's you draw specific meshes / areas for use with Unity's navigation system, but it does not generate any NavMeshes itself.
     
  43. QYeti

    QYeti

    Joined:
    Jan 10, 2014
    Posts:
    2
    Hello, I've run across a bug. If you click "New NavMesh" on NavMeshManager, then start drawing a few points (I used 6 verts to draw a concave shape) in the scene, then control click to add a new point on a sub mesh (only one vert), then turn off editing, there will sometimes be an exception. It doesn't always happen, but it appears to happen about 40% of the time.

    I realize that's not the intended way to use the tool, but I did it by accident and had to delete and redraw the mesh to fix it.

    First exception is:
    Code (csharp):
    1. Failed setting triangles. Some indices are referencing out of bounds vertices. IndexCount: 24, VertexCount: 0
    2. UnityEngine.Mesh:set_triangles(Int32[])
    3. NavMeshExtension.NavMeshObjectEditor:DeleteSelected(Boolean) (at Assets/NavMeshExtension/Scripts/Editor/NavMeshObjectEditor.cs:487)
    4. NavMeshExtension.NavMeshObjectEditor:CheckCombine() (at Assets/NavMeshExtension/Scripts/Editor/NavMeshObjectEditor.cs:349)
    5. NavMeshExtension.NavMeshObjectEditor:LeaveEditMode() (at Assets/NavMeshExtension/Scripts/Editor/NavMeshObjectEditor.cs:289)
    6. NavMeshExtension.NavMeshObjectEditor:OnInspectorGUI() (at Assets/NavMeshExtension/Scripts/Editor/NavMeshObjectEditor.cs:90)
    7. UnityEditor.DockArea:OnGUI()
    All the following exceptions are:
    Code (csharp):
    1. IndexOutOfRangeException: Array index is out of range.
    2. NavMeshExtension.NavMeshObjectEditor.DrawPolygonOutline () (at Assets/NavMeshExtension/Scripts/Editor/NavMeshObjectEditor.cs:581)
    3. NavMeshExtension.NavMeshObjectEditor.OnSceneGUI () (at Assets/NavMeshExtension/Scripts/Editor/NavMeshObjectEditor.cs:259)
    4. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    5. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    6. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    7. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    8. UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2411)
    9. UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1740)
    10. UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1572)
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
  44. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi @SloppyDepot,

    thanks for the report. If this is not critical to you, I will try to reproduce and fix this for the next update.
     
  45. QYeti

    QYeti

    Joined:
    Jan 10, 2014
    Posts:
    2
    It's not critical, thanks for looking into it.
     
  46. flgrafica

    flgrafica

    Joined:
    Mar 20, 2018
    Posts:
    3
    Hi!
    I used navmesh extension for create path, but when I exported the game it see the path.
    How can I do for do not see the path my game?
     

    Attached Files:

  47. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Hi, you can disable the Renderer component (in the inspector) on the NavMesh you've created.
     
  48. flgrafica

    flgrafica

    Joined:
    Mar 20, 2018
    Posts:
    3
    thank you!
    it is working:)
     
  49. StonedLover

    StonedLover

    Joined:
    Apr 16, 2014
    Posts:
    47
    Am I right thats not possible to change a normal nav mesh build with the nav mehs system ?
     
  50. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,158
    Not sure what you mean by "normal nav mesh build" and "the nav mesh system"? What do you want to change and how?