I'm doing a simple grid based game, where the player should only be able to move on the grey cells. It works quite ok, but in this simple scenario, the player is able to walk through Wall(1), although there is a collider on it and I'm checking with a raycast before moving. When removing the (nonblocking) pickup, the collider works. I'm assuming, the raycast is hitting the collider of the pickup, when the player is on that position and therefor misses the collision with the wall. What is a good practice to handle this issue?
The best way is probably to or use different layers to differentiate between collectibles and obstacles. In the raycast function you can use the layerMask parameter to include only the layers you want to check.
An alternative is to use RaycastAll to get a list of collisions to check for your obstacles.