Unlocking Doors
Abstract
Non-player characters (NPCs) interacting with doors can be a surprisingly complex gameplay feature that is often underestimated by developers. This chapter will provide a guide for anyone trying to implement doors in their game as we walk step-by-step through the creation of a door with increasing capabilities, from a simple manually-controlled sliding door to a swinging door complete with NPC opening animations and automatic closing. Along the journey we will tackle many of the common questions tackled when creating doors. This will include how to allow NPCs to find a path through and open a closed door, how to restrict NPCs to only pass through doors in a single direction, how to close a door when all of the NPCs have passed through, and how to prevent NPCs from blocking doorways or opening doors. Throughout the chapter, you will find examples made using the Unreal engine; however, everything we describe should be possible in any modern engine. In cases where there are multiple ways to solve a particular problem, we will also discuss the advantages of drawbacks of those alternate solutions.
Fields of Study & Subjects
Artificial Intelligence in Games
Digital Games and Media
Computer Graphics and Visualization Techniques
Publication details
- Journal / source
- CRC Press eBooks
- Pages
- 170–185
- Publication date
- 4 March 2026
- Language
- EN
- Document type
- Book chapter