- A* version: 5.2.5
- Unity version: 2022.3.51f1
Hi!
First of all I’d like to say that we really like and appreciate your project!
We have been using it for quite a while in a project where the AI is mostly just randomly walking around in different scenes.
I have started making some new scenes for our project, where the setup is a bit more complex than what we did before. In that light, I found that Filtering Objects By Tags doesn’t seem to work. Here is a snapshot of our scene:
The buildings in this snapshot are ‘Untagged’, the walkway is tagged ‘AiTraversable’ and the roads are tagged ‘AiTraversableVehicle’. Below are the settings we use for generating the Recast graph:
As you can see, A* is generating a graph on all the objects, while I only want it to make a graph on the walkways.
I’ve tried to switch to Filtering Objects by Layers (both the walkway and the road are on the ‘Ground’ Layer, which we use for different purposes). When setting the Layer Mask to Ground and scanning again, A* works as expected and draws a graph on the walkway and the road.
Are you aware of any bugs that cause the Filter Objects By Tags not to work as expected?
Actually, now that I am writing this I found out that by first setting the Layer Mask to Nothing, then switching back to Tags and setting the Tag mask gives the expected result. It looks like when filtering by Tags you overwrite this by reading the Layer Mask. AFAIK this is not intended behavior, and it’d be great if you can make a fix for this 
Thanks!
Thanks!
That was indeed a bug. I’ll include a fix in the next update.
Hi Aron,
I just downloaded and tested your latest release, v5.3.3.
Filter Objects by Tags is not working at all now, in my instance.
All elements are included regardless of which Tag is used.
I’m using it together with a PerLayerModification, which should exclude some specific layers. This also does not seem to work.
Again, when testing some more I found that first setting Filter Objects By Tags, adding the correct Tags (AiTraversable), and then switching back to Filter Objects By Layers (Layer Mask: Nothing) results in correct AINavMeshes. So it looks like there is still something going wrong with your initial filtering.
I took a look at the patch notes really quick and I do see this in them:
Fixed the layer mask for the recast graph would be used even if the graph was set to filter by tags, not by layers.
Before Aron sees this I wanted to ask this, based on the patch notes- what if you set it to Filter By Layers, select some layers, then go back to Filter By Tags? What happens then on your end?
At any rate thanks for letting us know about this 
Hi!
Thanks for following up
.
Ok, I’ll try and explain it. Some more background:
- We simulate a UAV flying around.
- I have a small city with a couple of layers; Ground (for all the ground), Water, Untagged (buildings, mostly). I need the Ground and Water layers as the UAV uses those to determine its height above ground.
- There are of course pathways and roads, as explained in my first post, with the tags ‘AiTraversable’ and ‘AiTraversableVehicle’.
Clearing the Tag mask, then switching to Filter Objects By Layers and setting the Layer Mask to Ground works as expected - all the ground is included.
Then I switch back to Filter By Tags (without clearing the Filter Objects By Layers), and add AiTraversable as the Tag Mask.
In this case the rooftops, roads, and water are included - practically everything.
For completeness, I then switched back to Filter By Layers, and set the Layer Mask to Nothing.
Then I get the result I expect:
Gotcha- thanks for the screenshots and information, very helpful! Looks like this one may require more digging into, possibly. Thanks for letting us know 
Thanks!
This was indeed a bug. I’ll include a fix in the next update.