How can I check if your touching the side or the top o a platform? In my game you can swing your sword down to bounce of the side of a wall to bounce off, but since i dont know how to check if you touched the side or the top, i had orginized it so that i have two tilemaps, one for the wall and one for the floor but this solution causes other problems
There are a few ways to check: This video covers 3 of them. But in short depending on the game, collision, raycasting down, sphere cast, relative position, bounds intersection etc.
There are a lot of ways, which one is best for you really depends on what you are trying to do. I think the most common approach is probably ray-casting down so you might as well start there.
raycasting down wont help. i am trying to detect if you hit a wall or a platform. if i raycast sideways cause then when the sword swings down, i can only have a small spot to detect where you can bounce off, what if you hit it will the bottom part of the sword? And i also cant raycast down cause i dont want to bounce of the ground, only the walls.