2d surface effector collider mask

I thought the collider mask would say ‘hey if this one is not checked, then dont run the surface effector on it’ but it seems to totally override the main edge collider. Basically I have a slick platform, i don’t want it to effect enemies just the player, though if I set it up and have the collider mask not have enemy selected on the surface effector 2d then they fall right through it? Anyway as a work around to make it where this just doesn’t effect the enemies but the platform remains solid? another edge collider?

The effector mask works the same as the collision layer matrix but locally for the colliders using that effector. It’s not there to turn the behaviour on/off for those layers.

That said, it’s an interesting option to allow controlling the behaviour that way and something I’ve noted down as there’s a rewrite for effectors on the roadmap. Unfortunately I cannot think of a workaround for you.

Thank you for the response. I just envisioned a scenario where the effector works on the player but not the enemies running on the surface. Perhaps another edge collider I could make that has a different collision mask and no effector? I am not sure how hard to implement or inefficient this might be.

You can certainly have another collider on a child GameObject the same as the one the effector is using that only the enemies contact and that would work. Unfortunately it just means doubling-up colliders which isn’t a problem if you don’t have hundreds of these things and you’re not bothered about ensuring both colliders stay the same.

1 Like