Skip to content

08. Adding Environments

Thomas "Tabski" Bartlett edited this page Dec 13, 2025 · 1 revision

If you've used the Unity editor before, environments will be the easiest thing to configure. They are literally just a CharacterToggleId with a prefab.

Editing an existing prefab

  • This is easier to do in a clean scene; go to Scenes/Sandbox
  • Drag in an existing environment to use as a base. I chose Prefabs/CharacterCreatorRooms/Outside
image
  • Right click the prefab in the hierarchy and do Prefab->Unpack
image

Now, we can edit this to our hearts content.

I personally added a little skybox thing using a tool called Spacescape

image

Lighting

OK, there is actually one weird thing here: the lighting solution is something custom I've added. It bakes vertex lights into the mesh, but you won't see them in the editor by default.

  • In the Hierarchy, find the VertexBakingRoot. Click it
image
  • In the inspector, expand the Settings
image
  • Check Show Even in Editor

  • Hit Bake

  • You should now see some shading on the objects in the scene

image
  • You can adjust the Sky Color and Shadow Color

  • You can also adjust the Light objects and their values.

    • Tip: Turn Gizmos on to actually see these in the scene

image

Finalizing into a Toggle

Once we're happy with our scene:

  • Select the VertexColorBakingRoot
  • Uncheck Show Even in Editor
  • Click Clear
  • Hit Bake
  • This ensures the meshes actually save properly. These colored meshes are generated, so they can't actually be serialized.

image
  • Drag and drop the root of your environment into your mod folder
image
  • Go back to the Scenes/CharacterCreator scene

  • Make a copy of a room toggle into your mod folder. i.e. ScriptableObjects\CharacterCompositor\CharacterToggleId\zRoom\zRoom-Outdoors

image
  1. Give it an appropriate Display Name
  2. Set the Order->Index appropriately
  3. Change the Room Prefab to the one we just saved
image

And that's it! We've got a new environment.

image

Clone this wiki locally