Jumping from a floor to another floor (2D)

Hello, I want my to 2D character to be able to jump from a floor to another, by passing throught it, and then walking on it. I joined an explanatory picture.

alt text

Can you tell me how to do it ? Thank you for your responses.

Hello,

You need to modify the physics setting “on runtime” so if you go to the edit > physics/physics2d you’ll see this little “table” on the bottom. This table shows you how objects will collide.
You can edit those settings via scripts and you need to make sure to switch them back after. So for the example:

if(Player.rigidbody2D.velociy.y > 0)
    Physics.IgnoreCollision(someLayer, someOtherLayer, true);
else
    Physics.IgnoreCollision(someLayer, someOtherLayer, false);

Hope you get the idea.

Regards,
M.Rogalski

When the player is in the air and below the maximum jump point (the apex), disable collisions with the platforms layer. When the player starts going down again, enable collisions.

To detect the direction (up/down) the player is going while jumping, you could use Rigidbody2D.velocity.