i’m making a 2d vertical scrolling game, all the world’s objects (walls, obstacles, etc.) are part of tilemaps, when the player collides with any object i need to get what side of the player collided, i’ve tried all the answers in this post and found similar solutions on this forum, the problem is, all of them use the position of the colliding object to find the side, that worked when colliding with standalone objects but didnt work when colliding with tiles in a tilemap since the collider always return
the same fixed position of the Tilemap object. I know there mey be another ways to solve this issue but i just dont know what to do to get this working properly.
Can you use the position of the collision relative to the colliding player to figure out what side was collided with? When you receive a collision you should know the location of the collision. E.g. if it’s greater than the X location of your player’s center, but less than the extents of the player’s bounding box on the Y axis, then you’d know the collision occurred on the right side of the player.
there are only two sides right? left and right? why not put on the player a “right” collider and a “left” collider?