One way walls

In most platforming games there are often special types of floor which have collision on one side alone. This allows players to jump onto it from above, but they won’t fall through once they are on top. I have found a hacky way to do this by checking every update if there is one of these tiles above or below the player, if one is above disable its wall and if it’s below then enable it, however this requires an extension, seems computationally expensive, and is unreliable. I was wondering if there was a cleaner solution to this, as it’s quite common in almost all popular platformers, and I’m hoping to include it in mine.

1 Like

I will try to find a way to do this.

1 Like

Here’s a code that I’ve used in the past. As far as I know, it’s one of the only ones, and its a little bit buggy
Also, welcome to the community!


Thank you all. Since this post was made/approved I’ve made some optimisations and came across a solution similar to kiwipheonix’s one, although instead of setting all locations, it’s just if the player is directly above/below one, then applies the change to it and it’s immediate neighbours. This seems to have improved reliability by a little, although I was wondering if it could be achieved without a forever loop, to help performance.
Thanks again!