My raycasting has 3 possible hits - UI, empty space or some game object that I spawn.
The game begins with timescale as 0 since it requires the user to select some configuration which then spawns the objects. At this step after spawning objects but before resuming timescale 1 my raycast doesn’t work on those spawned objects. I checked in the editor and they are there and the correct scripts are attached for correct detection. The raycast is still able to detect UI and empty space hits, but not object hits.
After I click my built in play button, which sets timescale to 1, the raycasting works fine.
I use Physics.Raycast to cast a ray on the objects.