So it looks like the collision area of the tile is being shifted down the y axis by 16 pixels for some reason. Does it have something to do with the conversion to a tile? The player isn’t affected, so I looked into some tile map properties to no effect.
Any more ideas?
Benjamin Stammen | 2017-01-18 00:44
I think that having a Collision Shape of 16px by 16px change it to 16px wide by 32px high, from the size of your sprite (tile), if your sprite is a rectangle the Collision Shape should also be a rectangle and not a square.
Try to do that and tell me.
Aquiles | 2017-01-18 01:55
Alright, so I adjusted it to the size of the sprite (32x64), and it fills the entire sprite. Unfortunately, I really only want half of the wall to be collidable in order to let the player be blocked partially by the front walls. Essentially, I need to figure out how to make the collision area of the walls in the world to be the same as when they’re in the file.
I’m going to keep trying to find new ways to shift the collision area down.
EDIT: it also seems as though changing the collision area’s position and exporting it to a tileset again doesn’t change anything. It seems like tiles just don’t take its original position into account.
Not sure if this is best practice or not, but I ended up opening the converted tileset and using the inspector to plug in offsets that worked for me! Then any map that uses that tile should use it as intended. The offset tools are pretty comprehensive.
For what I saw on an image, it seems related to the use of CollisionShape2D (I know it has some problems but I have never seen this bug).
Try with CollisionPolygon2D instead when making the tileset scene.
When using CollisionPolygon2D, it actually does align correctly for me! Maybe it’s because I fiddled with something in the meantime, but it seems surprising that the more general polygon model would work but not the more specific sub-case of the rectangle collider.