Character too fast on Navmesh links [Unity 2023]

I’m retaking this course to refresh my skills, and to get back in the groove to follow the dialogues and shops “chapters” I recently purchased. I’m also following in Unhity 2023 to stay up to date and partially for a challenge. I figured out how the new Navmesh components system works (at least figured it out enough to have all other lessons so far work properly), but there’s a bit that’s behaving oddly.

The map I designed for my gameplay moment includes a river (with water unlike Rick’s because at this point I already have assets for that; so i created a plane and assigned materials and shaders and all that; I also assigned it a navmesh obstacle component to stop players and guards walk all over it), and the alternative route I thought about requires the player to cross the river on a ford rather than the bridge. Trying to figure out how to make the ford if the surface of the water is unwalkable, I tried to create an invisible plane and add a Navmesh link component to it to juin the two banks of the rivers. It sort of works, but the problem is that the player moves over it at a significantly higher speed than when walking anywhere else, and it’s jarring.
I checked the link component and it’s set to be part of the walkable areas, not the jump ones. No other parameter I tried to tweak had any effect.

So my question is, how do I define the movement speed over a link? How come it’s not the same as moving over the rest of the navmesh? (I kinda understood it’s automatic, in that once you get on it the character is crossing it no matter what)

As a bonus question, if this is not the ideal way to create a fordable river, how would you do it?

NavMeshLinks are usually for things like jumping (like rather than a Ford, jumping across the river), and the NavMeshAgent tends to do these very quickly (or in a jump, it looks like those old Six Million Dollar Man episodes where Steve Austin jumps in super slow mo, also jarring).

What I would do is create a new Area in the user defined Areas section and name it Water. Set the Cost to 1000. This guarantees that you won’t even be able to select a path within the Water.

Then, where your Ford is, add a NavMeshModifierVolume and shape it in the area of the Ford. Set the NavMeshModifierVolume to an Area Type of Walkable.

Now, when you bake, the river will be covered in NavMesh, but it will be the color of the Water Area. I chose User16, which is a nice dark color to indicate that no, this is not really going to be walkable.

Now the only problem with this approach is that the character will still end up walking ON the water, since this is what we’re modifying.

So here’s another approach, though it takes a LOT more work.
Create NavMeshModifierVolumes (they are square) and use them to cover all of the river where you DON’T want walking to happen. Then put a NavMeshModifierVolume on the ford where you DO want walking to happen. For the water object, put a NavMeshModifier on it, and set it to “remove object”.

The trickiest part for this is that you’re going to have to sculpt your terrain to put this ford in the water in such a way that it’s actually walkable, if it’s too steep a slope, the system won’t create a path even with these steps.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms