Skip to content

Recommended way to implement "holes" in navmesh? #29

Closed
@verekia

Description

@verekia

This library is fantastic! I managed to get pathfinding working very easily for a game. Thank you so much @frapa.

But I have a question. How would you recommend adding holes to a navmesh?

Let's say we have a square:

[
  [0, 0],
  [0, 100],
  [100, 100],
  [100, 0],
]

But I don't want the whole square to be walkable. I would like to have a smaller inner square obstacle, for instance:

[
  [20, 20],
  [20, 80],
  [80, 80],
  [80, 20],
]

I managed to get this case working in the online editor by creating 2 polygons and connecting them: Shaped like [ and ].

Screenshot 2023-06-12 at 01 34 57

That's fine for a simple case like this, but for a video game with a complex map and many obstacles in the middle of the map, I am not sure how to proceed. This method would be very tedious. Any recommendation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions