Per Layer Modification Doesn't Seem to Change Anything (4.3.39)


Using version 4.3.39 Pro in Unity 2020.2.1f

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.

Is there anything I can do to get it working or any ETA on it working with 2D?

No ETA I’m afraid.

You can always do the collision testing yourself which might be easier in your game. See

No worries on the ETA.

I had already started looking into the code to write a 2D checker to do what I need.

I do have a minor followup, when iterating over the context nodes, is there a better way to get back node data from the NativeArrays than:[i]).node

Or is that the preferred way?

You can’t get the node object at that point, they do not exist yet (well, they might if this is a graph update, but in general they do not).

However, all the node data can be accessed from Documentation

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.

1 Like