Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navmesh Tilemap help wanted #195

Open
switchCTRL opened this issue Apr 30, 2024 · 3 comments
Open

Navmesh Tilemap help wanted #195

switchCTRL opened this issue Apr 30, 2024 · 3 comments

Comments

@switchCTRL
Copy link

Hi!
I've been trying to get NavMeshPlus to work with Tilemaps for some time now. Unfortunately, I'm encountering some difficulties.
The mesh never looks as expected. I'm probably configuring something wrong.

My current setup is as follows:
Let´s say I have a Grid with 2 rectangular Tilemaps:

  • Level 0
  • Level 1
Bildschirmfoto 2024-04-30 um 13 39 04 Bildschirmfoto 2024-04-30 um 13 41 00

My Tiles are custom rule tiles each with a custom physics body. I tried to set the Use Geometry to Colliders. Then I get this Mesh:
Bildschirmfoto 2024-04-30 um 13 45 19

If I set it to Render Meshes (which I think is not what I need because some tiles are "half" tiles) it looks like this:
Bildschirmfoto 2024-04-30 um 13 46 22

In both cases the agents can run through the cliff of Level 1 which should not be possible. Is there a way to get multiple tile map layers to work?

@h8man
Copy link
Owner

h8man commented May 3, 2024

You have navmesh modifier + tilemap modifier, but you need only one of them

@switchCTRL
Copy link
Author

Thanks for the response and sorry for my late answer.
The NavMeshModifierTilemap has NavMeshModifier as requirement.
Bildschirmfoto 2024-05-03 um 09 18 16
If I use only the NavMeshModifier in combination with PhysicsColliders I get the result from the first screenshot. I assume one cannot have both, using physics shapes and define specific tiles as walkable, fast walkable, water etc.?

What I want to achieve is that the layers of my tile map are walkable on their own. If I connect them with stairs or something similar one can travel from on layer to another.
Like in this picture:
Bildschirmfoto 2024-05-05 um 12 51 11

where

  • Green is walkable
  • Blue is water (later the character may be able to swim)
  • Yellow is fast walkable
  • The stairs connect layer 0 and 1 (without stairs the character should not be able to travel between these two layers).
    Is a setup like this possible?

@h8man
Copy link
Owner

h8man commented May 6, 2024

I'm very sorry, I check that from a code, and didn't notice modifier is used by builder.
So yes, Navigation Modifier is required with Modifier Tilemap.
Here is sample:
https://github.com/h8man/RedHotSweetPepper/tree/master/Assets/Scenes/SampleSceneTilemapModifier

Try this scene to get a feel on how to works, as documentation is not updated right now

As for layers, Navigation doesn't support layers in traditional sense, cause everything is projected into 1 navigation mesh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants