Labyrinth Game – Making a simple first-person game in unity

Updated information about this project

This article belongs to a series that consist on making a first person game about finding objects inside a maze. It’s one of my very first series from the channel. Now I reworked this project and you can download it to import in your own Unity project. Some day I will make a new series about this project, subscribe to my channel to see all the fresh content about Blender, Unity and programming.

Follow me on itch.io and download the source code of this project

YOU CAN TRY THIS GAME HERE, IT MAY TAKE A LITTLE WHILE TO LOAD
🔻

MOVEMENT: WASD CAMERA LOOK: MOUSE

Introduction of the old article

In this series we are going to create a simple game in Unity from scratch, the idea is to observe the tools that has the engine for creating video games.

The series currently has 13 videos in the channel and 11 articles in which it is detailed step by step what is done in each video, so you can see quickly in video format and analyze the parts of interest in detail by consulting the articles.

Before I start I invite you to visit and subscribe to my channel to find more videos about programming and 3D design.

Go to the Channel

Characteristics of the project

In principle we are going to create a first person game for the Windows platform, the scenario will be a labyrinth with several entry and exit doors.

The character will start in one of the doors and will have to find a hidden object in the labyrinth that will appear randomly, when he finds it he will have to go through one of the doors.

There will be a time limit to fulfill the objective but inside the labyrinth there will be collectable objects that will increase the time that the player has.

List of articles and videos

#1 – Introduction.

We start a new project from Unity HUB and talk a bit about the development environment. We import some elements from the Standard Assets package and from Unity’s Asset Store. We makea simple scene using Unity primitives and apply transformations. We create materials. We place the Standard Assets prefab “FirstPersonCharacter” in the hierarchy. The project is configured to compile.

[embedyt] https://www.youtube.com/watch?v=8f7K25yagh8[/embedyt]

#2 – Import Assets. Configure Skybox.

We import the 3D models and textures provided in the download links and place them in the Unity hierarchy. We add the textures to the materials. We create Prefabs that are prefabricated GameObjects that can be reused. We create a material and configure it to use it as Skybox, with this we change the aspect to the sky of the scene.

[embedyt] https://www.youtube.com/watch?v=EGTMWYhJrdQ[/embedyt]

3D Models and Textures

272 Downloads

#3 – Types of Colliders. RigidBody.

AddComponenet button to add components to a GameObject. Different types of Colliders, in particular Box Collider, Sphere Collider and Mesh Collider. Character behavior when contacting Colliders. RigidBody component and its relationship with the Colliders. Collider behavior in Trigger mode.

[embedyt] https://www.youtube.com/watch?v=Fa7q_2zMZCc[/embedyt]

#4 – Place the character in a random position.

We set up a system to place the character at a specific point on the stage. Creation of Tags or labels. Creation of the first Script in C# that will have the function of finding all the objects in the hierarchy that have a certain tag, sorting them in a vector, randomly selecting one of those objects and placing the character in the position of that object.

[embedyt] https://www.youtube.com/watch?v=4ZvweknJG84[/embedyt]

GameControl script with comments

206 Downloads

#5 – Create simple user interface. Canvas.

Create a simple graphical interface with Canvas. Two screens are made, one for the main menu and one for the game. Because the game is solved in a scene the screens of the interface are alternated.

[embedyt] https://www.youtube.com/watch?v=5Q_VU7QEQuA[/embedyt]

#6 – Programming of the user interface.

The user interface created in the previous video is programmed. When you press the Start button from the menu, the game starts. Use the escape key to return to the main menu.

[embedyt] https://www.youtube.com/watch?v=qY94nQIycxo[/embedyt]

GameControl script with comments

195 Downloads

#7 – Timer for the countdown.

We created a Timer in C#. Interaction between Scripts, from one Script we execute methods belonging to another.

[embedyt] https://www.youtube.com/watch?v=jptPdOg8t3U[/embedyt]

GameControl and Timer scripts with comments.

794 Downloads

#8 – Create, model and texturize terrain in Unity.

Creation of terrain with relief and textures. Terrain component and tools.

[embedyt] https://www.youtube.com/watch?v=Cm9eGK0dRts[/embedyt]

Download textures for the terrain

751 Downloads

#9 – Place object in random labyrinth position.

Strategy for placing an object at a random point in the labyrinth.

[embedyt] https://www.youtube.com/watch?v=8J5NM7TxFPE[/embedyt]

Scripts GameControl, Timer and LabyrinthPiece with comments

188 Downloads

#10 – Place collectables in random labyrinth positions.

Place collectible objects on Unity. System of creation and destruction of the collectables. Effect when collecting them.

[embedyt] https://www.youtube.com/watch?v=jbx3NXfzL30[/embedyt]

Scripts GameControl, Timer, LabyrinthPiece and Clock with comments.

223 Downloads

#11 – Special programming challenge for Halloween

This video consists of a special challenge in which we will add a little fear to the project. Somewhere in the labyrinth there will be a special pedestal, which will contain Lucy’s remains. If the character encounters this, Lucy will appear and chase after him. Everything that is done in this video will not be used in later videos.

See the concept of this programming challenge

It’s a much longer video than the others because a lot of things are done. Import Assets, configure materials and animations, Scripts.

[embedyt] https://www.youtube.com/watch?v=4G0Ggcb45M0[/embedyt]

GDT Halloween Pack

361 Downloads

Scroll to Top
Secured By miniOrange