Building Escape (C++)



This is a small game I made while discovering Unreal Engine 4.0. The player starts in a dimly lit room with some weird looking furniture. He has to find out how to escape the room by interacting with objects and the room itself.

When the player stands on a pressure pad, that is highlighted by a spotlight, the door opens, but when he tries to go through the door, it closes before the player reaches it. To get through the door, the player has to put a certain weight on the pressure pad, by placing objects on it.

Started: 3 March 2018
Finished: 10 March 2018


Source Code


This class is for picking up and dropping objects. The class detects if the player is in reach of a physics body and attaching it to the Physics Handle that is on the player, if he presses the shift key or right mouse button. If he releases the button, the object is dropped.

The class begins by searching for a Physics Handle and an Input Component on the player. The input component detects if a button is pressed or released and calls the function that is attached to it.

In the TickComponent, a line is traced from the player’s camera to see if there is something in front of him that can be attached to the Physics Handle.