Two different collision shapes (or bodies) on one node that will collide with different layers?

Godot Version

4.3

Question

Is it possible for one node to have two different collision shapes (or bodies) that will collide with different layers?

I’m currently making water drops that will blend with others, when they’re close (only visually, by using some shader magic). However, for their sprites to blend properly and look good, I need them to be really close to each other, but at the same time I want them to also collide with the floor (and other droplets of course). If I make their collision shape small enough for the blending effect, it will also cause them to clip through the floor a little, since their actual sprite size is larger than their collision shape (which is not a problem between droplets, it looks fine there).
All nodes, except the floor, also have to be moved by physics (RigidBody 2D).

I tried to make this scenario work in different ways, but got no luck so far, there I always encountered problems with some objects not respecting the collisions I set up.

Is there any way to make this work or should I try completely different approach?

I prepared a truly professional sketch of my use case - Green and blue nodes can collide only with other nodes sharing the same color. Both, green and blue circles, are parts of one node moved by physics force.

collision_layer and collision_mask are on CollisionObject2D rather than the CollisionShape2D so I don’t think that’s possible.

You possibly could try using a AnimatableBody2D that you manually move around to follow your main body. This could have it’s own collision layer/mask for merging?

I have no idea if that is a viable or good idea, just an idea that popped into my head :sweat_smile: