Skip to content

lajawi/unity-navmesh-better-bake

Repository files navigation

Unity Better NavMesh Bake

A Unity package that enhances the NavMesh Surface baking process. Currently it only adds support for Terrain Trees.

Usage

Important

You need Unity's AI Navigation package. When you install this package, it should depend on it and install it automatically for you.

Install the package according to the installation instructions. Once installed, you can use the extra buttons from the NavMesh Surface to use this package to bake.

Screenshot of the NavMesh Surface component, with the extra buttons.

What this package currently does

  • Make real instances of terrain trees for baking (they get removed after baking). These trees support the following components:
    • LOD Groups, only used when Use Geometry is set to Render Meshes, takes precedence to just a Mesh Renderer and Mesh Filter on the root object of a tree
    • Mesh Renderer and Mesh Filter, only used when Use Geometry is set to Render Meshes, #Problems that may not be obvious
    • Colliders of any type, can be multiple, mix and matched, only used when Use Geometry is set to Physics Colliders
    • NavMesh Modifier
    • NavMesh Modifier Volume

Important

All components above need to be enabled to be used by the NavMesh Surface.

Problems that may not be obvious

Mesh Renderer & Mesh Filter

Important

Both a Mesh Renderer and Mesh Filter need to be on the tree, otherwise the Surface will not recognise it.

Installation

Option 1: Package Manager (recommended)

Open the Package Manager window, click on Add Package from Git URL ..., then enter the following:

https://github.com/lajawi/unity-navmesh-better-bake.git

Tip

Head to the Unity documentation for help if need be. https://docs.unity3d.com/Manual/upm-ui-giturl.html

Option 2: Manually Editing package.json

Add the following line to your project's Packages/manifest.json:

"com.github.lajawi.betternavmeshbake": "https://github.com/lajawi/unity-navmesh-better-bake.git"

About

Package to enhance Unity's NavMesh Surface baking process by including Terrain Trees

Topics

Resources

License

Stars

Watchers

Forks

Languages