21
2017
Using SharpNav with Unity
Noticed this SharpNav repository (Advanced Pathfinding for C#) at https://github.com/Robmaister/SharpNav
Since new unity versions support .NET 4.6, this should work in unity too,
the sample script below runs, but not sure how to access the navmesh or navigation features..
Instructions:
– Download SharpNav https://github.com/Robmaister/SharpNav
– Open SharpNav-master\SharpNav-master\Source\SharpNav.sln in VisualStudio
– Right click SharpNav on the Solution Explorer, select Build *Note: this compiles with 4.5.1
– Copy ‘SharpNav.DLL ‘, ‘Newtonsoft.Json.dll’ and ‘YamlDotNet.dll’ files from SharpNav-master\SharpNav-master\Binaries\SharpNav\Debug\ folder into unity project, Plugins/ – folder
– In Unity project, select .NET 4.6 in the player settings *Need to restart unity after this
– Download example mesh and add to scene, from: https://github.com/Robmaister/SharpNav/blob/96ddd939f292a4f4e76b460c1f783cdf1e9bcf41/Source/SharpNav.Examples/nav_test.obj
– Attach script below into empty gameobject
– Drag example mesh into meshFilter field in the empty gameobject script
– Hit Play! (nothing really happens.. would have to access the navmesh, but you are on your own now..*please post comment if you get it working, i’d like to know also : )
**Note: here is older unity project for Recast/Detour library: https://github.com/unitycoder/rcdtcs
Source:
Related Posts
Leave a comment
Recent posts
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
- Check if point is inside polygon 2D (using line intersection)
- UnityHub: Enable Create Project Button (without having to select Cloud Organization)
- UI: Make Tooltip background fit Text content length
- Pong-Wars in Unity
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub)