I’d want to ideally setup movement like that of move_and_slide, but be able to make it so you can only collide between the intersection of two colliders (area thats contained inside both colliders will be what collides with the player) named, let’s say A and B. I have found a post mentioning Prototyping levels with CSG — Godot Engine (stable) documentation in English, but that appears to be 3d only and another mentioning raycasts (which I still wouldn’t know how to use in a similar way to move_and_slide). I have thought of dynamically modifying the collision mask of objects if you are in within the area of A, but that would make it so you collide with parts of B that are outside of A whenever you enter A.
It sounds like you want to detect collision when the following criteria are fulfilled:
Collision happened inside the Collisionshape2D of objectA.
Collision happened inside the Collisionshape2D of objectB.
For that, you can first detect the collision itself. Afterwards, you can get the collision point and then ask the direct_space_state if objectA and objectB are colliding with the collision point.