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

Introduction

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.

#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.

3D Models and Textures

43 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.

#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.

GameControl script with comments

26 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.

#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.

GameControl script with comments

23 Downloads

#7 – Timer for the countdown.

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

GameControl and Timer scripts with comments.

23 Downloads

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

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

Download textures for the terrain

78 Downloads

#9 – Place object in random labyrinth position.

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

Scripts GameControl, Timer and LabyrinthPiece with comments

17 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.

Scripts GameControl, Timer, LabyrinthPiece and Clock with comments.

23 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.

GDT Halloween Pack

38 Downloads