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
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- 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
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on