In my map class I have an algorithm that is generating and merging box colliders together. These belong to the layer "Ground".
After that, in some places on my map I'm generating some new cubes on-the-fly, and some of these cubes I don't want to generate at all. So, I'm doing a raycast to determine if they should be added or not.
I'm doing these raycasts to check if the position they should be generated at have free space to the left and right. For both rays I'm checking if they hit a collider beloning to the layer "Ground".
But I don't get a hit at all!
I've tried to create two cubes in the editor and assign them to the layer "Ground". If I run the game then I get a hit between these two cubes. But I will never get a hit checking against my generated colliders.
I do this logic in the Start-method, is there any certain method in the life cycle when I can start to use my generated box colliders?