Why can my AIs walk into an unwalkable area (when kiting them like this)?

I also made the obstacle walkable, and if the AI got too close, it would get stuck walking on it. For some reason, the AI doesn’t change elevation to match where it’s walking on, it maintains a static elevation. I would like for its y to change depending on where it’s standing.

also here is my project download

Hi

This is due to how the AIPath movement script follows its path. It doesn’t really know about any walls, it just follows a list of point. It will always move towards a point slightly ahead of it (controlled by the “pick next waypoint distance” field), and this introduces some smoothing. In your case, this smoothing leads to it cutting corners a bit.

You could try the new FollowerEntity movement script, for which this will not happen.

Make sure the movement script’s raycast ground mask includes all objects that you want the agent to stand on, and that those objects have colliders.

I tried reducing PickNextWaypoint and that helped somewhat, although it still sometimes attaches itself to the further up mesh. Shouldn’t those two square meshes (in the second video) not be connected at all?

I made sure the Raycast Ground mask on the AI was set to ground, and the cubes are on layer ground and have colliders. In Pathfinder, path is also set to ground.

I changed the step height to get the player to climb up and over the cube in the center, but it still phases right through it without changing elevation:

Also, my project file is posted above, if that helps. Thank you!

The agent uses the Unity physics engine to do a raycast against the world, and use that to figure out where the ground is.
However, when the agent is already inside the cube, Unity’s raycast system will just ignore the cube for the purposes of raycasting, and it will instead hit the ground below it. If you have a slightly gentler slope, or make the agent taller (so that it’s center is higher than the cube), then it will work.

This depends on your graph settings. In this case, you might want to reduce the Max Climb setting. And possibly increase the erosion setting to 1.

That makes sense about how the ground raycast causing the issue. I increased the agent height and now everything is working as expected / should be what I need.

Well, except one more thing: The agent is very snappy when abruptly going up inclines, but smoothly falls down the incline. I would like for it to follow the visible mesh and go up smoothly as well. Video:

Thank you!