AI avoid static mesh

Hello,

I’m trying to make my AI move to a point somewhere in my map, but when I make a road using the trackgenerator demo and turn on collisions the AI will just bump into the guardrails and stop. I turned on RVOAvoidance and Rebauild at runtime but it doesn’t matter. Can anyone please help?

Here is how it looks:

The track is not affecting the NavMesh like you want it to.

First off, click on the ‘show’ button at the top of the screen and select ‘Navigation’. If nothing changes in the view then create a new nav mesh bounds volume and scale it over the walkable area of your terrain. This should fix the problem.

More likely however, is that the track is not set to alter the navmesh in any way. As a very brief summary - the navmesh is a way of marking up a surface to tell the AI they are allowed to walk there. If you select ‘Navigation’ from the ‘Show’ menu what you will probably see is that the entire surface of the floor is now green. This means there is valid navmesh over it. What you want to see are holes cut out where the track is.

In order to make this happen, locate the track sections in the content browser and find their mesh component, then select the option that says ‘Can Ever Affect Navigation’. The navmesh should rebuild and the agents should now take the correct path to their destination if one exists.

36956-navigation.png

If you don’t see the mesh update, just do a rebuild of either the whole solution or just the navigation in the scene (right click on the build menu)

Thanks! It worked :smiley: