I'm making a 2d game with grid based movement and to check if there's something to collide with in the cell where the player wants to move I'm using a Raycast2D.
I'm changing the its position rather than casting it to the cell where the player wants to move because if there's something in the same cell as the player, like some pickup that can't be picked (for gameplay porposes), it will only detect that pickup and not, for example a wall.
The thing is that this way the collisions work as usual with enemies and pickups (sprites with an area2d), but not with the tilemap.
I'm updating the raycast after moving it and all the tiles have collision shapes, so I don't know why this doesn't work. I would appreciate any help!