Someway to translate a static scene?


I’m wondering if anyone knows of a way to alter the position of a scene loaded additively? I’m running into an issue where the static batching of the scene is not letting me alter any of the Transforms. I could disable Static Batching but that would really suck. :slight_smile:

The reason why I’m asking is that our game has a series of rooms and I would like to randomly choose what hallway scene connects each room. In order to do that, I would need to be able to additively load the random hallway and then re-position it to connect to the exit/entrance of a room.

Thanks for the help!

You can actually perform static batching at runtime, which should fix this problem for you. See Unity - Scripting API: StaticBatchingUtility

Instead of marking stuff as static in the editor, what you could do is:

  1. Create your scenes with nothing marked as static.

  2. Load the scene additively and position it as needed.

  3. Call StaticBatchUtility.Combine on the parent node for the additively loaded scene.

This would allow you to do some movement before doing static batching. Just note that once you call Combine, you won’t be able to move things anymore. There may also be a slight computation overhead for that one frame where everything is batched.