many times in unity you will want to
connect to NAV meshes together to allow
characters to move between them for
example you may want to allow a
character to jump over a gap in the
ground or drop down from an elevated
height we can achieve this effect using
off mesh links off mesh links are
pathways that connect pieces of a nav
mesh so that nav mesh agents can
traverse them for more information on
nav mesh agents see the lesson linked
below we can create off mesh links in
two ways we can either allow unity to
generate them automatically or we can
manually place them with the off mesh
link component here we have a scene that
has a capsule with a nav mesh agent
attached the capsule also has a script
that will make the agent move towards
the target game object as you can see
the target game object is on the other
side of a gap and is thus on a different
piece of nav mesh in order to get unity
to generate off mesh links for us we
will need to select all navigationally
static objects in our scene that we want
links between in this case we will want
to select the two storage boxes once
selected we will want to check the off
mesh link generation checkbox next we
will want to go into the bake tab of the
navigation view the two properties that
affect off mesh link generation our drop
height and jump distance drop height
dictates how far of a drop is an
acceptable distance to create a link for
example it would be reasonable to be
able to drop off of a box but not a
skyscraper the jump distance determines
how far of a gap and off mesh link can
span once again the bigger the number
the further an agent can jump from one
nav mesh to another by default these are
set to zero so we will want to set them
to something that makes sense for our
scene it is worth noting that in order
to have unity generate off mesh links
you
need to disable the height mesh property
when you're done setting your properties
you will simply click the bake button
you will see any generated off mesh
links in the scene view if we run our
scene we can see that the agent is now
able to traverse the gap and reach its
destination the second way to create off
mesh links is manually with the off mesh
link component creating links this way
gives us better control over where they
are placed and how we can interact with
them here we have the same scene as
before except we have removed the
generated off mesh links and added two
new empty game objects which are named
link start and link end these will be
the game objects that we create our link
between to add an off mesh link
component to an object click the add
component button and select navigation
off mesh link the first two properties
of the off nestling component start and
end require the game objects that will
represent the start and end of our link
this means that the component doesn't
have to be on an object that is a part
of the link though organizationally it
is a good idea the cost override is used
to adjust the cost of the link for the
purposes of calculating a path if this
property is not a positive number it
will be ignored and the default value
will be used by directional dictates
whether or not a character can traverse
in both directions across a link the
activated property allows you to turn a
link on and off auto update positions
determines whether or not the link will
be updated if either of the start or end
transforms are modified the navigation
layer is the layer that the off mesh
link belongs to for more information on
navigation layers see the lesson on
navmesh baking linked below it is worth
noting that once you have setup your off
mesh link
poni you do not need to rebake your
navmesh the link will automatically be
visible on the navmesh when you open the
navigation view we can now run our scene
and see the agent move across our newly
created off mesh link