#Colliders with different layers

6 messages · Page 1 of 1 (latest)

tame patrol
#

is it possible to have several colliders but different layers on them? on characterbody2d theres only one option regardless of how many colliders attached to it

rain lance
#

Yes - but this assumes your top-level node is not a CharacterBody but rather made up of other collision (or area) shapes; e.g.

#

Each of these can have there own collision layers.

#

For a more complete example, this fella has two collision shapes with different layers:

tame patrol
rain lance
#

Yep, you can do that - the bear example has a collider configuration for selection and hit detection, while the range body is for distance checking (e.g. raycasts) without interfering with the combat/select colliders. I can’t comment on your game specifically so it might take some playing around to get what you’re after (the top level movement can still be character body-based, the important bit is composition) although ultimately, I think you’re on the right track!