Skip to content

Walk-in buildings

For creatorsAdd-on 2.2.2+

You build a two-room house that the hero walks into and climbs, with a table turned at an angle and an invisible fence, and the horde follows you inside and up the stairs.

▶ Play the test scene: the controls of tutorial 21. Walk in through the front door. The horde follows.

Any object can say how it collides:

collision = What it does Use it for
mesh The object’s own triangles. Walls block, floors and stairs are walked on, doorways are open A building you walk into
hull The object’s convex hull: it hugs a turned or rounded shape where a box would not Vehicles, furniture, rocks
box The object’s bounds Crates, plain walls
none Nothing Decoration

An object whose name starts with UCX_, on its own or as a child of another object, is a custom convex piece: solid, and never drawn. Use it for an invisible wall, or as a simple stand-in for a complicated shape. Many asset packs ship with these pieces already in place.

  1. Model the house. Two rooms, a front door, an inner doorway, a floor 0.15 m up and stairs to an upper floor. Make each doorway at least 1 m wide and each step no taller than 0.45 m.

  2. Tag it. Select the house and choose Properties ▸ Object ▸ Simulacrum ▸ Add Component ▸ Physics & Collision ▸ Collision, with collision = mesh. To tag it by hand instead, add a custom property named collision of type String with the value mesh. Blender’s new properties start as numbers, and a number is not a tag value. Right-click the property ▸ Copy to Selected to tag many objects at once.

  3. Add furniture. Put a table in the west room, turned 45°, with collision = hull. The hero stops at its flat side, not at a box round it.

  4. Fence the yard invisibly. Add a thin box along the yard’s edge and name it UCX_Fence. The hero stops at it, and players never see it.

  5. Use a finer grid for the horde. Set horde.cell = 0.5, so a 1 m doorway stays open to the zombies, and double the cell counts to match: horde.map = 80,64 covers 40 × 32 m, with horde.origin = -20,-16.

  6. Bake the floors. Press Nav on the toolbar. The horde now knows the upper floor and the stairs. Tutorial 25 covers the nav mesh in full.

  7. Press ▶ Play. Walk in through the front door and up the stairs. The zombies come in through the door and climb after you.

In a scene with mesh, hull or UCX_ collision, the third-person hero gets a full character controller:

  • it steps up anything up to 0.45 m;
  • it climbs slopes up to 60°, which lets it take a doorstep;
  • it slides along walls;
  • it stays on the ground going down stairs and slopes.

The camera stays inside the room, and a shot stops at the wall that is really there. Scenes without these tags play as before.

  • On the ground floor, walls, stairs and furniture block the zombies; floors don’t, and doorways stay open, so they come in through the doors.
  • Upstairs, the nav mesh holds every floor, stair tread and landing a body can stand on with 1.7 m of headroom. Zombies climb the stairs to your floor and are drawn at its height.
  • Bites reach only 1.6 m up or down. On a floor no stairs reach, such as a roof, you are out of reach, never bitten through the floor.
  • Shots have height. From a window you can hit the street; a level shot over a zombie’s head misses.
Tag Values What it does
collision mesh, hull, box or none How the object collides
UCX_ (name prefix) any object’s name A solid, invisible convex piece
horde.cell metres; 0.5 with walk-in buildings The horde’s grid cell
  • In a passage barely wider than the hero, the camera pulls in until the hero is hidden. Tight interiors want a closer camera (camera.dist).

Next: the city by district.