Creating objects & raycasting against them on awake/start

I am building a dungeon generation system, which the plan was to have each room know its exits, and check if there is room to generate the next piece before doing so.

The problem I am running into is that I am creating all of these objects on start, and so, they may be created, but their colliders cannot be raycasted against until the first FixedUpdate (a little bit of behaviour I found out about from the Physics.Raycast page:

Notes: This function will return false if you cast a ray from inside a sphere to the outside; this in an intended behaviour. If you move colliders from scripting or by animation, there needs to be at least one FixedUpdate executed so that the physics library can update it’s data structures, before a Raycast will hit the collider at it’s new position.

I don’t see any way on the physics page to manually force it to rebuild its data structures, but am wondering if there is a function in some other static class that can be called to force it to rebuild its collider data structures. If one exists, it would be a massive help.

If not, it would be possible to make it so that the generator can track what room it’s generating, and only add one room per FixedUpdate - but that would be a massive pain to write, and it would slow down the process of generating dungeons quite a bit.

How about Physics.Linecast()? i think this function doesn’t get the inside/outside problem. But for the FixedUpdate, i don’t know a way to force the system update. You can do Collider.Raycast() one by one. I guess it doesn’t need the physics library to update but it’s slower.

In the worst case, you can make your generate process in an Ienumerator loop with WaitForFixedUpdate.