Are you ready to dive into the world of Unreal Engine and create a simple, yet engaging, collectible game? In this tutorial, we will guide you through the process of building a collectible coins game in Unreal Engine. You will learn how to create a customizable game environment, set up the coins logic and the player’s score. By the end of this tutorial, you will have developed a functional and entertaining game where the player can collect coins and increase their score.
To follow this tutorial, you should have a basic understanding of the following concepts:
Table of contents
Make sure to download the necessary project files so you can follow along with the tutorial. These files include pre-designed assets to start building your game, as well as completed versions of the project files for reference.
Download Project Files Here
In the Blueprints folder, create a new blueprint of type Actor called Coin. We can start by setting up its components. Create a new static mesh component.
- Set the Static Mesh to Coin
- Set the Location to 2.6, -18, -98
- Set the Rotation to 90, 0, 0
- Set the Scale to 50, 50, 50
- Set the Collision Presets to Trigger
Over in the event graph, we can setup the logic for the rotating first. To begin, create a new float variable called RotateSpeed and give it a default value of 90. Then every frame, we can rotate it along its Z (up) axis.
Compile, save then return to the level editor and place a coin down in the world. Pressing play, you should see it rotate around.
Next, let’s go over to the Player blueprint in order to setup the player’s score. Create a new integer variable called Score.
Then create a new function called AddScore, with an integer input called ScoreToAdd. This function is just going to add that input to our current score.
Compile and save that, then return to the Coin blueprint. Here, we want to check for collisions with the player, and if so – add to their score then destroy the coin.
Back in the level editor, we should be able to collect the coin.
We hope you enjoyed this tutorial on creating a simple collectible coins game in Unreal Engine! By now, you should have a better understanding of the engine’s mechanics and how to manipulate blueprints and events to create a functional game. This project can be a great starting point for further expansion and customization, such as adding new levels, challenges, or even incorporating this mechanic into your own projects.
If you’re looking to continue learning and improving your Unreal Engine skills, make sure to check out Zenva’s other courses and tutorials on various topics, such as creating VR experiences or adventure games. We wish you the best of luck in your future game development journey – happy coding!
Want to learn more? Try our complete CONSTRUCT AN ARCADE GAME IN UNREAL ENGINE course.
FINAL DAYS: Unlock coding courses in Unity, Unreal, Python, Godot and more.