I am trying to use NavMeshAgent to move the player around in Unity.
But the doorway is not connected in NavMesh so the player can't pass through.
is there any way to add navmesh path at the doorway so that the player can go through?
I tried to change step height and max slop but does not work...
CodePudding user response:
you should use Nav Mesh dynamic for this, you need to add Nav Mesh obstacle to your door and make it non-static. also make sure that you have checked the "carve" .
The agent can pass through the doorway if you open the door or move it up at run time. Make sure your character radious is thin enough as well and also adjust height of the agent if you want to move the door up.
CodePudding user response:
I solved the issue by adding Off Mesh Link
to the door object like @Voidsay suggested.
After adding the Off Mesh Link
, it correctly shows the path and I can pass through the door.
Just selecting the floor objects both outside and inside the door to Start
and End
in Off Mesh Link
did the trick.