I am using a Recast graph with the settings below:
I have set 4 layers in the Layer Mask: Ground, Player, Opponent, and Obstacles.
Additionally, I have attached to each GameObject (Unity cube) in the Obstacles layer the RecastMeshObj with the settings below:
After Scanning, the “Ground” layer is detected well, but some GameObjects in the “Opponent” layer are not detected. This results in some Opponents getting marked as unwalkable, but some others with the same configuration (except their meshes) not getting marked as unwalkable. Similarly, the cube GameObjects, which are all in the “Obstacles” layer don’t get marked as unwalkable, even after I attach the RecastMeshObj to them as I mentioned above. This can be seen in the following screenshot:
In this screenshot showing a part of the Raycast graph, the graph fits very well over the racetrack, which is in the “Ground” layer (the brownish area below the racetrack is in the “Default” layer). On the top left of the image, we can see one of the cars inside an unwalkable area, and on the bottom right another car is within the main walkable area, while both cars are in the “Opponent” layer. Three white cubes are also visible within the main walkable area, even though they have the settings I mentioned above.
I tried changing many settings of the Recast graph but there was no change in what was detected as unwalkable. e.g. The screenshot below is when I set the cell size to 0.23 (from the default 0.5).
I have also tried using a Grid graph. In this case, all cars and obstacles were correctly detected as unwalkable, but I faced some other problems with the Grid graph, so I started trying other graphs.
EDIT: I forgot to mention that all cars also have the DynamicGridObstacle component on them.
I’d appreciate your feedback on this.
Thank you in advance!