I am using the NavMeshSurface component in Unity to generate a navmesh of walkable areas in a procedurally generated level. I am working on some basic behavior to use with a NavMeshAgent. I want to find a random point for the agent to wander to, but I want to check if the position is within the walkable area before telling the agent to start navigating.
The problem is that I can't find a method to check if a point is within the NavMeshSurface. My search results reference the NavMesh having a similar method but not NavMeshSurface. Is there an easy way to check if the point is in bounds? Can I access the NavMesh and ray/sphere cast against it? Any solutions would be great. If there is a different free option, I am open to exploring it.
Thanks. Let me know if you require more information.