There seems to be a relatively rare bug when parenting models into an atomic model during the replication period
I’ve found this when creating a house loading system where models of the house got loaded in as chucks at a time rather than loading the entire house at once. I would then have code run when these models loaded in (can guarantee that all the submodels should have been loaded in) and found that I was getting rare errors where sometimes the submodels would not load in. These errors went away when I removed splitting up the atomic model and instead sent the entire atomic model to be streamed in/parented together. This retained the “snapshot” properly
I also have a vehicle system where vehicles get built up after the base gets replicated to the client (adds body of the vehicle, wheels, ect). This is throwing similar errors so I think these all fall under the same issue
I don’t have an easy to replicate repo of this issue, it is very hit or miss
Alright so I reverted my house loading back to where it did not parent the entire atomic model at once to simulate the bug
In this specific case I have a lightswitch that has a submodel, and within that submodel I have a part. I wanted to test if the submodel got loaded in, and then test is the part got loaded into the submodel
It was not able to find the submodel after a 3 second WaitForChild() yield which makes me believe that no submodels/subinstances are getting loaded in at all
I can’t create a consistent repo place but I could create a place that is essentially house loading code that constantly runs
To get these results I have to publish to my live game, wait a few hours, and wait for a random client to encounter it because I’ve never been able to replicate the issue. I’m not sure it will occur in ideal environments
Following up with this as this appears to be expected behavior according to another staff member:
Essentially what was happening was I would take all the descendants of the house, break their parents (parent to nil), and then rebuild in an order to load it in. On the load in, even though it would load back into an atomic model, it would do it in batches and may not send the entire atomic model at once. This breaks the atomic snapshot, thus resulting in an atomic model not being atomic
This should be documented somewhere. Developers expect atomic models, no matter how they are instantiated in, to actually be atomic