Escape from the Maze – A game about finding objects made in Unity

The game Escape from the Maze is a first person game made in Unity and consists of finding a series of objects before time runs out. This prototype was a commissioned work.

Initially the project was much simpler than what you can see in the prototype below, since it was a work with clear instructions that emphasized the logic and mechanics of the game rather than the graphical aspect. After delivering the work I continued doing lighting and post-processing experiments, I added a 3D model of a person with animations from Mixamo so that shadows of the player are projected on the walls of the maze. The project is not optimized for the WebGL version so it is likely to run very slow in full screen.

Game objective

You are inside a maze, the only exit is locked and can only be opened with the key. Inside the maze there are six hidden objects. Go through the maze and find all the objects so that the key appears. Get the key and escape from the maze. 





Game mechanics

We will now analyze the different elements of the game.

Player-controlled character

The player controls the character using the directional arrows or the WASD keys, the camera is controlled with the mouse. I don’t remember well but it may be the prefabricated “First Person Controller” from Standard Assets.

Objects to find in the labyrinth

The six objects to be found appear in the maze randomly and at a certain distance from each other. To achieve this, an instantiation system was created that takes into account the shape of the parts of the maze and the regions where the objects could appear.

The objects emit a sound whose intensity depends on the player’s distance, the closer the player is to the object the louder the sound will be heard, this is a clue to locate them.

In order to detect that the player picks up the objects, Colliders and the OnTriggerEnter event are used, when picking up an object, it is checked if all the objects have been picked up, if this is true, the key is released.

The key to unlock the exit

The key is like a seventh object that is instantiated using the same system as the previous objects, the difference is that doing so we immediately deactivate the GameObject of the key so that it disappears from the stage, when the player finds all the objects the GameObject of the key appears and a sign in the graphical interface indicating that you have to find the key.

The door to escape from the maze

The door is a 3D model divided into two parts so that it can be opened, and there is a Collider just ahead to check if the player is in front of it.

If the player enters the region in front of the door we check if he has picked up the key, if not the action is ineffective, but if the player has the key the door opens with a rotation animation for each object in the door.

Technical Details

Next we are going to review some information about the inner workings of this game, first of all it is a 3D project developed with the Unity engine.

The 3D models of the scenery are models that I made using Blender and the textures with Substance Painter, this process took about an hour approximately because I already knew exactly what I had to do and I had even done it before.

Given the simplicity of the prototype I used a single Unity scene, so there was no need to worry about transferring information between scenes.

All the GUI elements of the main menu are children of a GameObject that is inside a Canvas, the GUI during the gameplay is also built that way, so when starting the game what is done is to deactivate the GameObject that contains the GUI elements and activate the GameObject that contains the game’s GUI.

Secured By miniOrange