Hi,
I am not sure how you set this up, but raycast should hit only one object.
A common problem with a raycast from a player, is the starting position from the raycast.
When close to an object (wall) and the raycast position is against or in the wall it will not detect the wall and will cast thru the wall.