Training Livestream - Getting Started with Gameplay Programming - July 27 - Live from Epic HQ

The code part of limiting a camera’s movement to a “room” can be fairly simple, if the room is a convex hull. (Convex hulls are shapes where any two points inside the shape can be connected by a straight line that doesn’t go outside the shape.) The interesting question about this is how your designers want to set up the boundaries that define the rooms, and how you harvest this data, or if you detect it dynamically. Some ways might include placing special Components or Actors that register themselves with the local GameState, or just placing special geometry above the map that the camera detects with collision tests. I’d love to get back to this, and maybe do a little more camera work in a future stream, but the code from this stream should help to get started, and then the concepts I’ve just described might put you a step forward. If you want to do distinct rooms, it might be a good idea to spawn a second camera in the new room (when moving from one room to another), configure it with anything that room requires (FOV settings or any other room-specific custom details) and then set that to be your view target, possibly with a blend time if you prefer a panning transition (like Super Metroid) to a jump-cut (like in Shadow Complex). You can delete the original camera when the transition is complete, or just save it so you can move it to a new room the next time you need to transition. I hope this gives you some ideas. But above all, as long as you’re making sure each part of your game feels good, you’re on a path to making an enjoyable experience.