Pocket Room Setup

Updated 2 weeks ago

Pocket Room Template

To start off, it will probably be easiest to just download and apply this pocket room template to your (hopefully already patched) Unity project: https://github.com/MelanieMelicious/Lethal-Company-Pocket-Rooms-Guide/releases/tag/Template

This template should already have the basic minimum required in making a working room. Though you'll still likely want to make changes to prevent overlap with other rooms.

Pocket Room Setup

Assuming you downloaded and applied the template project package, in [Assets > MelaniePocketRoomTemplate > Prefab], you should find ExampleRoom0.prefab. Double-click this to open the example room prefab. The object hierarchy should look like this:

Everything under PocketRoomDoor0 should be the entrance door from the ship, going into the pocket room. Everything under ExampleRoom0.1 should be the entirety of your pocket room, and the exit door back to the ship. Selecting ExampleRoom0.1, and looking at its properties in the Inspector tab, you should now see this:

Pocket Room (Script) component is where you will define a list of trigger colliders to be considered inside your room (in order to save items, place furniture, and keep players alive when going into orbit, while in said rooms), and the position and rotation offset of where your room exists, relative to the ship. You will likely want to keep position Y high above the ship, as anywhere too close to the ground level, or under it, may cause issues. You will also want to avoid having multiple rooms sharing the same space, or being too close that they overlap inside each other. The Box Collider component in the screenshot, is the bounds of the room, referenced in the list for Pocket Room (Script).

Under [ExampleRoom0.1 > Nav] should be everything navmesh related, for enemies to navigate inside your room.

[ExampleRoom0.1 > Nav > Nav0] is the only floor navigation in this example. You can change its size or shape based on your room, and duplicate it to fit different shapes, as long as it remains under [ExampleRoom0.1 > Nav]. To then apply said changes to the navmesh, selecting [ExampleRoom0.1 > Nav], and looking at its properties under the Inspector tab, once again, you should see a NavMeshSurface component. Here, you can find the Bake button, to apply your new navmesh.

[ExampleRoom0.1 > Nav > OffMeshLinks > Ladder0] is a basic navigation connection between the door on the ship, and the door in the pocket room. This allows enemies to path through the doors, while a teleport script should handle most enemies passing through. One end of the OffMeshLink, A, is under Ladder0, while the other end, B, is under PocketRoomDoor0, the door that can be moved around on the ship.

Under ExampleRoom0.1, you will find Teleport0. You will move this based on where you want the entrance of your pocket room (from inside the room) to be. This handles both enemy and player teleportation between the doors. Under PocketRoomDoor0, you will also find Teleport0 and Teleport1. One handling players, and one handling enemies. You will likely not need to change this as much, other than size depending on your entrance door (from the ship). In the Inspector tab for both Teleport0s, you will find a Room Teleport (Script) component, which is where you define the entrance and exit points for teleporting, and whether or not the door is to enter or leave the pocket room (mainly for configuring different enter and exit times).

Under [ExampleRoom0.1 > LightSwitch] is just a basic synced room light you can turn on and off, which I included in the template. You can remove this entirely without issue, if you would like to add your own lights (or no lights). Everything under [ExampleRoom0.1 > LightSwitch > Light] is disabled when turned off, so you can add any number of GameObjects (even non-lights) that disable when turned off, under it.

Lastly, any of the numbered Model# objects are just where I store my meshes and mesh colliders. You can change them however you want, or remove them to add a replacement instead. I do recommend applying any new meshes that is part of the pocket room, into the LOD Group component for said room (in this case, ExampleRoom0.1), to prevent the room being visible while outside it (you may need to adjust culling depending on size).

The End

uhhhh, I guess feel free to tell me if guide is good or bad, and what I should change, the end.