Bizare MeshRenderer translation issue

Hi everyone, this is my problem I’ve had with Unity, that I can’t quite figure out…

I’m building levels from room prefabs placed “randomly” (at the moment I’m just spitting them out via a defined plan in code).
When the player passes through an area trigger the game loads the a level asynchronously which contains a gameobject with the room prefabs in it. The level is then instantiated according to the plan generated above.

It has all been working beautifully up until thisafternoon when I’ve added enemy instantiations.
After enemy instantiations were added to the game, the floor gameobject and up to two wall gameobject children’s MeshRenderers of the first room prefabs seemingly teleport to the origin. The other rooms, which are instantiated from exactly the same prefabs are fine. The first room doesn’t even have the enemies in it.

I’ve spent two hours eliminating what’s occuring when parts of the room teleport, and it’s when I’m instantiating parts of each enemy. If I instantiate any part, MeshRenderers of parts of the first room will display locked in the origin.
The actual gameobject that holds the floor and random walls is not teleporting. The position and localPosition of the gameObject doesn’t change, and neither does any of it’s parent objects in the heirarchy…

The first image I’ve attached shows the object with the meshrenderer rendering at the origin.


The second image is a test where I move the game object in the inspector. The collision and everything else move but the meshrender still renders the floor object at the origin!

Commenting out the enemy instantiations “resolves” the issue, but I’ve taken pains to eliminate any links between the enemies spawning and any changes to the level by commenting everything else out, but if I instantiate any part of the enemy (graphics, shadow or brain), the floor will move!

Can someone please explain what might be happening? This is driving me nuts!
Thanks a bundle
Alister

Has noone had a case where a gameobject is placed somewhere in the world but forces itself to render in the origin? There are no scripts running on the object, all the way up the hierarchy. I know these are just test objects but I’m concerned the engine will freak out with the full assets when they’re completed by the artist!
Thanks for your time and thoughts in advance.

Will no-one help?

Have you tried instantiating the enemies first, followed by the rooms? Also, how have you setup the additive levels? What do they contain? The additive content needs to be repositioned in order to match the current layout, correct? Have you tried using asset bundles instead?

Thankyou so much for replying Tinus!
Instantiating the enemies before or after the rooms made no difference. The first room’s floor gameobject would render at the origin (with randomly one or two more walls rendering at the origin also).

When playing around with them just then I tried unchecking the ‘static’ box, and it no longer renders random objects at the origin.
Then I wrote a function to set static on a transform and children recursively, and it doesn’t seem to teleport to origin anymore…

But it scares me Tinus, the timing of it seems to be very delicate…

Thanks again for taking the time to reply, while playing around with your suggestions it led me to try unchecking the static box on the room prefab and getting it to work again.