Rigidbody2D.Slide combined with Platformeffector

I’m having troubles setting up a PlatformEffector2D on a BoxCollider while moving my object with Rigibody2d.Slide.

I’m aiming to archive only having collision, when being the top of the collider.
No matter what Surface Arc I choose, there is always collision on the sides of the platform.

For reproducing on a simple enviroment I used the "Rigidbody2d_SlideMoveAlignAngle example from the Physics2d-Example Repository(https://github.com/Unity-Technologies/PhysicsExamples2D).

Setting up the scene like this, the result will always be that the character stops at the selected collider. The goal is, that it would move through the collider, since it is coming from the side.

Slide doesn’t interact with effectors that modify contacts such as the PlatformEffector2D, it’s a method that uses physics queries, not simulation contacts to move.

The PlatformEffector2D is for normal simulation work where a contact is created and the effector has the chance to disable a contact. Slide doesn’t produce contacts nor does it have to run during the simulation step.

Hey,
thanks for the answer.
So this basically means, I wont be able to use Slide to move through Colliders?

To answer more directly, the options used to control what it can and cannot contact are contained here: https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rigidbody2D.SlideMovement.html

Right now that’s LayerMask only.

That said, as part of the ongoing effort here, there was discussion to extend the options here to include a callback to user to allow you to control if it should contact something or not (called during a Slide operation).

No actually implementation date or plan though, just something noted that would be a good extension to the options.