How to prevent stepping off the bridge and not getting a conveyor belt effect?

I dropped a “house base” instance into the river as a makeshift bridge (it has a nice flat top) and for some reason I couldn’t prevent the navmesh to make a connection from it down to the water (besides having same height drop as with the shoreline), so I added some invisible fences with navmesh obstacles on the bridge’s sides. That in itself works reasonably well, except for an issue where the character glides along the fence object as if on a rail or conveyor belt. And at the end of it the character might try to turn around and run into the fence field again, only to be repelled over and over…

So, trying to jump into the water is not a recommended activity. Plastering the whole river with obstacle objects so it’s surface will not be a navmesh area on its own doesn’t seem like it would be a viable option, though…

If you’re using an object to “be” the water (a common technique, make a plane with a water texture on it, and place in the depression that is the water), you should be able to put a NavMeshModifier (or NavMeshObstacle for legacy NavMesh) on that plane. Even when using multiple objects for this, that is the general workflow. Each GameObject representing the river would have the component.

If the river is being represented by a texture on the terrain, the only real option is adding a lot of invisible NavMeshObstacles/Modifiers.

In terms of gliding along the fence object, that is odd behavior. Almost as if the NavMesh thought the way was still valid but the character was blocked by the collider. Did you rebake the NavMesh after adding the invisible fences?

I rebaked the navmesh all the time…
I posted screenshots of it in the #rpg channel on discord

I will try placing a planar object on the lower elevation level to cover all of the waterline area.

As long as your water line is below everything else in the scene, a plane with a NavMeshObstacle (make sure it’s static) should do the trick.

Eventually I managed to fix it. It was activating the “carve” checkbox on the fencing obstacles, after all.


1 Like

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

Privacy & Terms