So I have a few layers that I am hoping to use as penalty indicators rather than obstacles and when I came across the Per Layer Modification options I was pretty happy.
That said, when I set the per layer modification things, it still just marks the nodes as unwalkable rather than tagging them and if I turn off the Obstacle Layer Mask it seems to do nothing even if it set the per-layer option to set them as unwalkable.
So what am I missing here or is this just not working at present?
Some Example Screenshots With Explanations:
Obstacle layer set to NPCCollision. In the above case, the nodes that have colliders are marked unwalkable, rather than being tagged which is what I would expect.
Obstacle layer disabled. In the above case, the nodes are all walkable (which is expected).
So I’m just not sure if some additional setup is required or if this isn’t yet operational or what I’m missing, but any guidance would be greatly appreciated.
Also, a minor feature request, I would love to be able to directly set penalty via this Per Layer Modification since the later majority of my map is static and tile based and only has one sort of NPC and being able to bake that in via layer checks would be glorious. Though obviously the tagging works at the moment.
Sorry, ‘per layer modifications’ do not work as well for 2D physics at the moment. The reason is that it uses the layer from the ‘height testing’ pass, which isn’t used for 2D physics.
Alrighty, I slapped together something that does more or less what I want.
Here’s a gist with the script and custom editor so it shows up in case anyone else wants to set things based on a LayerMask:
You could also just pass-through the context graph collision and use that, but I’m manually tweaking some things there and I’ve also found that I don’t get the same hits as the walkability check on the base scan even if I set the diameter to 1. But again, good baseline for people to build off of if they need it.
I would have done a Per Layer thing like the original structure, but just went with a Mask because it works for my needs and was faster.