Topic was automatically imported from the old Question2Answer platform.
Asked By
Syton
Hello.
I’m working on a 2d platforming game and I’m using a tilemap for the platforms (and many other stuff), I wanted to know if there is a way to define the collision of some of the tiles (or all of the tiles and create a 2nd tilemap) to one way collision using godot 4?
Just fumbled through this myself. The solution isn’t super intuitive, but it’s there.
I am in Godot 4.0.2 stable
First, make sure your collision shapes are set up (skip down if you are done with this):
Tileset > Tiles > Paint
Select a Physics Layer
Add the shapes to the one way tiles
*Note: in my case I needed to configure my tileset to have 2 separate physics layers, I use different collision layers for my one-way tiles. This isn’t really necessary on all projects though.
*Note again: in my screenshots you will see downward arrows on each collision shape - those will only appear after turning on one-way collision
Hope this helps!
Godot version 4.0.2 stable
Which way is the innitial one Way collision and how do you change it?
I have a wall where I would like to add to One Way Collisions.
One at the top so you cant walk throuhg it while walking upwards and one at the bottom so you cant walk through it while walking downwards.
The one at the bottom is working but for some reason the one at the top is.
I set up two Polygons and turned on One Way for both of them.
I also already played with the “One Way Margin” but that didn’t seem to help… (setting it to 1 and -1 to see if it changes the One Way direction)
Is there any other way to do it or is it really just the “One Way Margin” and I am too stupid to set this up…
If its possible to change the direction of a one way tile in a tilemap, it would be great to know. In my isometric tilemap, they are all the opposite way then I would like.
I’m in the same situation of having a n horizontal ledge from what I would like to be able to fall (so traverse from top to bottom), but not to climb (so not traverse from bottom to top).
One way works only bottom-to-top indeed.
Is there any other way?