Creating a Semi-Solid platform

I want to make a semi-solid platform which allows the player to jump into it from above from below, but collides with it from above. I am using physics 2.0.
I’m running into a problem where the platforms are able to be passed through no matter which side you come from.
Events:


What I am doing here is checking if the player is moving upwards. If yes, turn the collision off. If the player is moving down and not touching the platform, turn the collision back on.
Any way to fix? Or is there a different approach I can take?

I don’t have a solution but some ideas. If you disable a physics layer, I don’t know if the physics behavior will still detect collisions. It’s worth testing.

Another approach would be to compare the Y() value of the objects maybe using points or bounding box or maybe send a short ray cast or use point is inside above and below.

The platform behavior would be easier. It has jumpthru platforms.

Point is inside and ray cast would have the benefit of picking the platform.

If a point above is inside platform disable layer
If a point below is inside platform enable layer

How could I make the platform object work with phsyics 2.0? Or would it be easier to switch the a character controller?

Mixing the 2 behaviors would be difficult. Only 1 should be enabled at a time otherwise they’ll fight each other with each trying to add their own forces. The platform behavior is much more fitted for platforms than physics

I have switched to platformer and its working a lot better

1 Like