<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ unreal-engine - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ unreal-engine - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 25 May 2026 15:48:55 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/unreal-engine/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Unreal Engine 5 Course – Learn How to Code Video Games ]]>
                </title>
                <description>
                    <![CDATA[ Unreal Engine 5 is a powerful game engine that has been used to create some of the most popular and critically acclaimed games in recent years.  We just published an 11-hour Unreal Engine course for beginners on the freeCodeCamp.org YouTube channel. ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/developing-games-using-unreal-engine-5/</link>
                <guid isPermaLink="false">66b20210a8b92c9329236447</guid>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Wed, 11 Jan 2023 15:27:28 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/01/ue3.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Unreal Engine 5 is a powerful game engine that has been used to create some of the most popular and critically acclaimed games in recent years. </p>
<p>We just published an 11-hour Unreal Engine course for beginners on the freeCodeCamp.org YouTube channel. Sourav created this coruse. He has 7 years of game development experience and has created multiple games.</p>
<p>This complete course is designed for beginners who are new to the engine and want to learn the basics of creating games and interactive experiences with it. In this course, we'll be taking you through all of the key features of the engine and showing you how to use them to create your own projects.</p>
<h3 id="heading-system-requirements">System Requirements</h3>
<p>Before you begin the course, it's important to make sure that you have the necessary system requirements to run Unreal Engine 5. The minimum requirements for the engine are a 64-bit operating system (Windows or Linux), 8 GB of RAM, and a Direct3D 11 or Metal graphics card. You'll also need to have a modern web browser and an internet connection to download the engine and access the course materials.</p>
<h3 id="heading-installing">Installing</h3>
<p>The Engine The first step in getting started with Unreal Engine 5 is to install the engine on your computer. This process is simple and straightforward, and we'll walk you through it step-by-step in the course. Once the engine is installed, you'll be ready to start creating your own projects.</p>
<h3 id="heading-creating-a-project">Creating A Project</h3>
<p>Once you've got the engine installed, the next step is to create a new project. We'll show you how to do this, and how to customize your project settings to suit your needs. You'll learn how to set up basic lighting, import assets and create a simple playable level.</p>
<h3 id="heading-unreal-editor-basics">Unreal Editor Basics</h3>
<p>Once you've created a project, the next step is to get familiar with the Unreal Editor. This is the main tool you'll use to create your game or interactive experience, and it's packed with features that will help you to create, test, and iterate on your project. We'll take you through the basics of the editor, such as navigating the interface and using the various tools and panels.</p>
<h3 id="heading-creating-levels">Creating Levels</h3>
<p>One of the key components of any game is the level design, and Unreal Engine 5 makes it easy to create and edit levels. We'll show you how to use the various tools and features in the editor to create levels that are interesting, fun to play, and visually appealing. You'll learn how to create landscapes, place objects, and set up basic lighting.</p>
<h3 id="heading-landscapes">Landscapes</h3>
<p>Unreal Engine 5 features a powerful landscape system that allows you to create huge and detailed outdoor environments. We'll show you how to use this system to create mountains, valleys, rivers and lakes with ease. You'll also learn how to import height maps and sculpt the landscape.</p>
<h3 id="heading-blueprints">Blueprints</h3>
<p>Blueprints is a visual scripting system that allows you to create interactive elements in your project without having to write a single line of code. We'll show you how to use blueprints to create variables, structures, enumerations and functions. You'll also learn how to use Blueprint Macros and collapsed graphs. We'll take you through the process of creating branching and looping logic, and learn how to use blueprint arrays and flip-flops.</p>
<h3 id="heading-object-oriented-programming">Object Oriented Programming</h3>
<p>Object-oriented programming is a powerful way of organizing your code and creating reusable components. We'll show you how to use Blueprints to create classes, actors, and work with basic inheritance hierarchy. You'll also learn how to use casting and exposure on spawn.</p>
<h3 id="heading-interaction-system">Interaction System</h3>
<p>Creating interactive elements is an important part of any game or interactive experience. We'll show you how to use the interaction system in Unreal Engine 5 to create objects that can be picked up, moved, and interacted with. You'll also learn how to use Line trace (Raycast) to create interactive elements.</p>
<h3 id="heading-modelling-tools">Modelling Tools</h3>
<p>Creating and importing 3D assets is an important part of any game or interactive experience. Unreal Engine 5 includes a variety of modelling tools that you can use to create and import your own assets. We'll show you how to use these tools to create Static Meshes, Nanite, Materials, Skeletal Mesh and Anim BP.</p>
<h3 id="heading-c-prerequisites">C++ Prerequisites</h3>
<p>For those who are interested in programming, this course also includes a section on C++ in Unreal Engine 5. However, before diving into C++, it's important to have some understanding of the language and its concepts. We'll provide a brief overview of C++ basics, and explain how C++ is used in Unreal Engine 5.</p>
<h3 id="heading-c-basics">C++: Basics</h3>
<p>After having the C++ prerequisites, we'll take you through the basics of programming in C++ in Unreal Engine 5. You'll learn about variables, functions, and other important concepts. We'll also show you how to use Unreal's built-in C++ functions and enumerations.</p>
<h3 id="heading-advanced-inheritance-hierarchy">Advanced Inheritance Hierarchy</h3>
<p>In addition to basic inheritance hierarchy, We'll show you how to use advanced inheritance hierarchy and understand the difference between UCLASS, UPROPERTY, UFUNCTION, USTRUCT and how to use them.</p>
<h3 id="heading-converting-blueprint">Converting Blueprint</h3>
<p>To C++ We'll also show you how to convert your Blueprints to C++, and how to use Blueprint Interface and C++ Interface. You'll learn how to use BlueprintImplementableEvent, BlueprintNativeEvent and the differences between them.</p>
<h3 id="heading-c-array-and-map">C++: Array and Map</h3>
<p>We'll take you through the process of creating and working with arrays and maps in C++.</p>
<h3 id="heading-actor-character-player-controller">Actor, Character, Player Controller</h3>
<p>In this section of the course, we'll cover advanced topics related to actors, characters, and player controllers. You'll learn about different types of Actors and Character, how to create custom Player Controllers and how to use them.</p>
<h3 id="heading-game-mode-and-game-state">Game Mode and Game State</h3>
<p>We'll show you how to use Game Mode and Game State in Unreal Engine 5 to control the overall behavior of your game. You'll learn how to set up different game modes and game states, and how to switch between them in your game.</p>
<h3 id="heading-creating-plugins">Creating Plugins</h3>
<p>Plugins are a powerful feature in Unreal Engine 5 that allow you to extend the functionality of the engine and add your own features. We'll show you how to create and use plugins, and how to use third-party libraries (static and DLL).</p>
<h3 id="heading-networking">Networking</h3>
<p>Creating multiplayer games is an important part of game development, and Unreal Engine 5 includes a variety of networking features that make it easy to create online games. We'll show you how to create and join sessions, how to replicate variables and how to use RPCs. You'll also learn how to use networking in C++.</p>
<h3 id="heading-unreal-engine-source">Unreal Engine Source</h3>
<p>We'll show you how to access the Unreal Engine source code, and how to switch between different versions of the engine.</p>
<h3 id="heading-packaging">Packaging</h3>
<p>Finally, We'll show you how to package your game or interactive experience so that it can be distributed and played on a variety of platforms. You'll learn how to build your project for different platforms and how to optimize it for performance and memory.</p>
<p>This course has been designed to cover all the key features of Unreal Engine 5 and provide a solid foundation for creating your own games and interactive experiences. Whether you're new to the engine or have some experience, this course will help you to take your skills to the next level.</p>
<p>Watch the full course on <a target="_blank" href="https://www.youtube.com/watch?v=6UlU_FsicK8">the freeCodeCamp.org YouTube channel</a> (11-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/6UlU_FsicK8" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Unreal Engine 5 Crash Course with Blueprint ]]>
                </title>
                <description>
                    <![CDATA[ Unreal Engine is one of the most popular game engines in use today. It can be helpful to learn if you are interested in 3D or 2D game development. We just published an Unreal Engine 5 crash course on the freeCodeCamp.org YouTube channel. Varnos Games... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/unreal-engine-5-crash-course-with-blueprint/</link>
                <guid isPermaLink="false">66b206c7eea9870582e16cdb</guid>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Thu, 03 Feb 2022 18:38:19 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/02/unrealengine.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Unreal Engine is one of the most popular game engines in use today. It can be helpful to learn if you are interested in 3D or 2D game development.</p>
<p>We just published an Unreal Engine 5 crash course on the freeCodeCamp.org YouTube channel. Varnos Games created this course.</p>
<p>You will learn how to create a game using the Blueprint Visual Scripting system. Blueprint is a complete gameplay scripting system based on the concept of using a node-based interface to create gameplay elements from within Unreal Editor.</p>
<p>This course is for absolute beginners. You will create a 3D game where players control a robot that needs to collect batteries scattered throughout the level.</p>
<p>Here are all the sections covered in this course:</p>
<ul>
<li>Blueprints in Unreal Engine</li>
<li>Basics of Unreal Engine 5</li>
<li>UI/UX</li>
<li>Win/Loss events</li>
<li>Basic Level design</li>
</ul>
<p>Watch the full course below or on <a target="_blank" href="https://www.youtube.com/watch?v=xl5fqr-CpTY">the freeCodeCamp.org YouTube channel</a> (2-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/xl5fqr-CpTY" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h3 id="heading-transcript">Transcript</h3>
<p>(autogenerated)</p>
<p>In this game dev course varnas games will teach you how to build games with Unreal Engine five, you will also learn how to use the blueprint visual scripting system that makes it simpler to create gameplay elements.</p>
<p>Hey, guys, thank you so much for checking this course out.</p>
<p>This is going to be a very, very beginner level, Unreal Engine five blueprints only course, we're going to make a simple game called the battery man.</p>
<p>So if I play this game, what's going to happen is I have a few batteries present all around the scene, I have to collect these batteries over here.</p>
<p>And once that's done, I either go to the new level, or I win the game.</p>
<p>So here, this is my second level.</p>
<p>And if I collect these batteries, I have my event condition.</p>
<p>And I always have a loose condition too.</p>
<p>So if I wait it out, if I don't collect any of these batteries over here, and wait for five seconds, I lose the game, I can quit if I want.</p>
<p>And if I can retry, we obviously still we have made many too.</p>
<p>So we're going over everything in this game, including UI validate taking a look at when conditions and emissions.</p>
<p>We're coding everything from scratch, we're using the Third Person template, but we're not using any of their built in movement, we're going to create our own character add our own functionality to these to this character.</p>
<p>So it's going to be a game that you have.</p>
<p>Hey, guys, and welcome back.</p>
<p>Now we will take a look at Unreal Engine five and try to create our own project.</p>
<p>So what you have to do is open up your Epic Games launcher.</p>
<p>And Epic Games launcher is essentially a poster to Unreal Engine and its marketplace.</p>
<p>So if I'm if I let's take a look at the marketplace over here.</p>
<p>So the marketplace essentially has all these different high quality assets that I can use.</p>
<p>And one thing I love about the marketplace is that has something called the free for the month five, where it chooses five paid assets from the asset store from the marketplace.</p>
<p>And it provides the users of Unreal Engine these assets for absolutely free.</p>
<p>So that is an amazing feature.</p>
<p>And that's why I love the Unreal Engine marketplace.</p>
<p>It has a lot of different high quality assets, and even Epic Games, most of it, most of the content Epic Games provides is completely free and you can use it in your game.</p>
<p>So try check out the marketplace and use this in your game.</p>
<p>It's not cheating, it's actually an amazing thing that you do know how to use other people's assets on your game, because that's how game development actually works.</p>
<p>Let's try and see how to install Unreal Engine five.</p>
<p>Now, if I open up the games launcher and open this up five part over here, it has my early it says Unreal Engine five early access.</p>
<p>Now Unreal Engine five is not complete, which is why it still says it's an early access.</p>
<p>But I can download my early access from here.</p>
<p>And I can also get the sample project that that they showed in the Unreal Engine five showcase video, which is amazing.</p>
<p>But once you're once you're done installing Unreal Engine file, if you go to your library, you will see your Unreal Engine five editor over here and I can open it up.</p>
<p>And over here.</p>
<p>If you scroll all the way down, if you go to Wall, you have all of the assets that you bought or claim I have all of these assets, all of these are free assets and they're amazing.</p>
<p>So try to check the assets out maybe you might like something and make them outfit.</p>
<p>Anyways, I can go here and hit launch.</p>
<p>And if it takes a while Don't worry, I have my Android version five installed on my HDD just because of how big it is.</p>
<p>Usually I have the engine on my HDD and then on my SSD is where I have all of my project saved.</p>
<p>So you can do that you can have the same approach or you can do something different it's completely up to you.</p>
<p>But that's usually what I do.</p>
<p>It takes a it takes a long time to open up Unreal Engine for me, essentially because of because I mean one I'm recording and two because of the fact that for Unreal Engine you need pretty decent specs I have like average specs for example you can see I have a six core CPU and memory when it comes to memory.</p>
<p>If you're trying to make a game using Unreal Engine make sure you have at least 16 GB RAM.</p>
<p>Don't try to create a game with eight GB it is not going to work out well for you especially if it's going to be a high scale game.</p>
<p>And make sure you have a good graphics card.</p>
<p>I have two GB RAM so I can barely get through this.</p>
<p>But if you if you're trying to if you're purchasing a new laptop or a new computer just for game development, make sure you have a good CPU which is six cores at least or more than six cores.</p>
<p>It uses a lot of CPU power.</p>
<p>So if I go to processes over here you can see Unreal Engine is hogging up my CPU like crazy.</p>
<p>And if I go to my performance again, memory, make sure you have like at least 16 GB RAM, especially on the engine five, you will not be able to get when I swear to God.</p>
<p>But anyways, let's go to games.</p>
<p>And but we have a lot of these templates over here.</p>
<p>So if you want to create a really quick prototype, the best part about Unreal Engine is that you can create prototypes really easily.</p>
<p>So if I want to create a first person prototype, I can, instead of creating the movement, the projectile movement, everything from scratch, I can just I can just use the template over here, and it will create it automatically for me.</p>
<p>So I have my shooting part, my keyboard, my, my joystick all of them built in, so I don't have to create it from scratch.</p>
<p>Now this this is very, very useful when it comes to game jams, necessarily you game jams or competitions, where you are given like a day or two days to create a game.</p>
<p>And for those, it's very, very useful.</p>
<p>So you can see I have a lot of these different projects, I'm going to be using third person, except we're going to create the animations, the game, whether the movement logic, everything from scratch.</p>
<p>So that's what I'm going to use the third person and the reason why I'm using third person.</p>
<p>Third Person project and not a blank project is because I have a lot of Unreal Engine provides a lot of animations.</p>
<p>And I need these animations in my game, I don't want to make my animations from scratch, which is fine, I'm going to use the third person project.</p>
<p>Now under quality patient, I'm going to use change mine to scalable, I'm going to enable static content static content essentially like a bunch of assets Unreal Engine gives for free like textures, materials, particles, etc.</p>
<p>Under project name, make sure there's no blueprint, not C++, there is not a C++ close, there is not a C++ course, the next the next course that I'll be releasing, that's going to be a C++ course of the same game.</p>
<p>Anyway, so I'm going to name this Batman and create project, this might take a while, especially if it's your first time, this might take a while for me not much.</p>
<p>But when it's compiling shaders, that's when it takes a very long time.</p>
<p>So if you have, if you have a project that has a lot of different gameplay logic and assets built into it, then it is going to take a very, very long time, especially because it has to compile the shaders.</p>
<p>Okay, now now that it's open up, you can see that we have this scene and all everyone opens up the third person scene.</p>
<p>This is the default scene over here, I have the the floors, there's a lot of cubes, the character, blah, blah, blah.</p>
<p>Let's start to go over all of these one by one.</p>
<p>Now I have to place actors tab where I have different confidence or actors that I can add on to my scene, what is an actor, an actor is an object that can be placed on the world.</p>
<p>This is an empty act.</p>
<p>And I can then add logic to this act over here.</p>
<p>Now how this works is that everything that can be placed onto the scene is an actor.</p>
<p>So the box trigger is essentially an actor.</p>
<p>Look at it this way.</p>
<p>A Tesla Model S for example, is a car.</p>
<p>It is an electric car, but still a car It derives from a car.</p>
<p>That's how this works over here.</p>
<p>The Empty Actor is universal everything that can be placed over here as an actor.</p>
<p>So this is an actor, this is an actor, but we have different types of actors.</p>
<p>So from an actor, something called upon is created upon as an actor that can be processed, processed, meaning it can you can add input actor to this to this point over here, for example, you can move the point like a vehicle etc.</p>
<p>Or character is basically attack upon that move around.</p>
<p>So this is how the hierarchy works.</p>
<p>You have an active force, under this actor, we have a point so the point inherits from an actor, and the character inherits from a point and basically has like mesh collision, etc.</p>
<p>Let's talk about collision Shelby, select this third person character and in the World Outliner, you can see that this third person character has been selected.</p>
<p>And under world settings, I have my game mode override.</p>
<p>We'll take a look at all of this later.</p>
<p>But let's go to a Details panel.</p>
<p>Underneath this panel, I have my capsule component, which is basically collision.</p>
<p>The way collision works in games is that you have a capsule you don't have all these complex collisions, like you know the exact shape of the character that is not going to happen.</p>
<p>It's very, very resource hungry.</p>
<p>We use simple collisions in our games.</p>
<p>And what permissions do is it makes sure it doesn't walk through the stairs over here unless you want to create a ghost.</p>
<p>I can move up the stairs I can Jump um solid the collision basically says okay this object is solid, but that does not make collision cannot be you know collision cannot be cannot walk through the wall it definitely can you have different presets.</p>
<p>For example, I can save my I can set my collision in such a way that I can move through stairs, but I cannot move through a floor, I can do that, I can definitely do that, all you have to do is select the capsule component.</p>
<p>And once you select the capsule component, and in this part over here we have different other we have different attributes essentially like the transform the shape, the navigation, all of that.</p>
<p>Now, the transform is universal for every single game engine, we have the location, the rotation and the scale.</p>
<p>The red is for the x axis, y is for them in the green is for Y axis and the blue for the Zed axis.</p>
<p>You can also see these arrows over here.</p>
<p>If I change this red arrow, if I hold this red arrow and like my mouse, you can see that my x axis is getting changed the same for my Y and my said, I can also move two axes at the same time.</p>
<p>For example, my Zed oops, okay, that's pretty good.</p>
<p>I can move my Zed and my bi axes at the same time.</p>
<p>Really, okay, I know what I'm going to move my x and my y, just because it's simple, you can see that my values, the corresponding values also change.</p>
<p>So I'm that then when you're trying to place objects, that is you'll sort of have to understand how to change all of these values.</p>
<p>Now I can also change the rotation, if I press E, I can change my rotation.</p>
<p>So you can see I can go up and down, I can change, for example.</p>
<p>Okay, let's let's actually go back.</p>
<p>If I, if I change the green part over here, you can see them changing by rotation with respect to my y axis, same goes to the blue and the red does not waste time.</p>
<p>And the scale is obviously the size of the character, I'm going to change this back to zero, I don't want a humongous character.</p>
<p>Okay, now mine is supposed to be one non zero, if it's zero, it's going to be it's not going to have the x dimension at all, it's going to be a two that it's going to be a two dimensional object, capsule component if I have something called mobility, and this is present for every single object.</p>
<p>So for example, if I select my network, the Mac, the star, play Star, essentially, it defines where my player should start, this is for the SS network player starts.</p>
<p>So that's for multiplayer.</p>
<p>So this capsule, probably under capsule company, if I have if I have something on mobility, it I can basically say if my character should be static, mobile or stationary.</p>
<p>If I'm if my character person gets some input and has to move in one of these accesses, or even rotate, I need to make sure that is movable.</p>
<p>Over here, I have my animations, we'll be going over all of this later on be recreating this from scratch, I have my mesh, I can select if I want to simulate physics or not.</p>
<p>And that gives realistic physics, I can enable gravity or disable gravity.</p>
<p>Actually, you know what, try to change all these values and try to see what it does.</p>
<p>That's the best way to learn to just explore the explore and try to change all these values.</p>
<p>Hopefully you don't break the engine.</p>
<p>I have my capsule competence.</p>
<p>So I basically have different competence attached to my character.</p>
<p>And these confidence have different attributes like my for example, my hair has different attributes by my legs have different attributes, but as a whole person.</p>
<p>So that is basically how this works.</p>
<p>It as a whole is a third person character and has different components attached to it, a hammer camera, etc.</p>
<p>Now, you can see that it says it's inherited over here, it means my if I hover over this, it says my parent classes character, What in hell would I mean by inheriting means this actually a programming concept.</p>
<p>And what this means is that the parent class has a set of attributes that I inherit on my child, this is this third person character, this is not this, this inherits from the character class.</p>
<p>So you can see the pen class it says the character class and the character class has the capsule component, the mesh, etc.</p>
<p>So I don't have to if I create a child of this third person, character, I mean the child of this character class and have all of the all of this melted.</p>
<p>Think of this as you think of your parents.</p>
<p>If you're if your parents have, let's say, brown eyes, the chances of you having blue eyes is pretty pretty low.</p>
<p>So you kind of inherit the genes from your parents, and it's getting passed on to the child.</p>
<p>That's how programming works too.</p>
<p>And that's why it's so beautiful.</p>
<p>Now when it comes to content browser, I have my blueprints and with the content boxes used to navigate through your game files And that's pretty much what it's used for.</p>
<p>And I have different folders.</p>
<p>This has been created by Unreal Engine automatically because of what template I've chosen.</p>
<p>So if I go to blueprints, I have a third person character.</p>
<p>Before that, let's first familiarize ourselves with the place actors Part Two, if I go to, I have different tabs over here under place actors, I have my directional light, my point light over here, sport light, all of that just like real life, I can, I can drag drag this value into the scene, and it has automatically selected whatever object I've added, I can change all of these values, for example, I can change the light color to like, an a blue, red, etc, I can change my intensity, I can either make an absolutely bright or very, very dark.</p>
<p>So the C D stands for CAD, CAD, do whatever, okay, I don't know, I started physics.</p>
<p>But anyways, that's what intensity is for my attenuation radius, that's all of these are physics light concepts.</p>
<p>So if you really liked physics, you'd probably be able to recognize all of these different variables over here.</p>
<p>Unfortunately, if you want to get really good game development, a little bit of physics, a little bit of math, it is important, because, you know, programming is essentially just math, and physics, but in a very, very practical bill.</p>
<p>So did you don't need to know math, physics and all of that.</p>
<p>But it does help a lot.</p>
<p>You can understand the concepts a lot better, especially when you have to debug something or add a completely new feature.</p>
<p>Anyways, let's not waste any more time.</p>
<p>And that's create a new level so that we can add our own characters, I mean, our own objects to the scene.</p>
<p>The fact if I click on my file, I can go to new level, I'm going to create a default level over here, and it'll automatically ask me to save this model over here.</p>
<p>Now, if I press Ctrl S, I can save this on my folder, I'm going to create like click over here create a new folder called scenes.</p>
<p>And I'm going to call this level one.</p>
<p>Actually, this should be called levels, I used to do this in Unity a lot.</p>
<p>It's supposed to be levels in Unity two, three policies.</p>
<p>There we go.</p>
<p>Okay, I'm going to remove the floor and the Player Start that they actually Yeah, put it over the place, we will add all of this.</p>
<p>I have, obviously I have something called atmospheric fog, which variable has a lot of influence on light.</p>
<p>But I can also add something called the exponential height fog with, which adds a lot of depth to the map.</p>
<p>Actually try to try to explore over here try to add different objects onto your scene, as I said, but we'll be creating something called a landscape over here.</p>
<p>So I have something called landscape tab.</p>
<p>If I click on this, you have something, okay.</p>
<p>All of these clients that you see over here, this is usually called gizmos in game development.</p>
<p>This applies for all all game engines, these lines, the basic call gizmos, and they're basically outlines of whatever object you have selected.</p>
<p>The reason why I'm painting the landscape and just not adding a cube over here and scaling it is because it is very, very well optimized landscapes are optimized for huge, huge levels.</p>
<p>And I'll actually show you why.</p>
<p>Over here, if I go to my landscape tab, I can change a lot of different values.</p>
<p>But all I'm going to worry about as my section size, I'm going to make the seven to seven chords.</p>
<p>So you can see it's seven over here and seven over here, I guess 1234 Yep, there we go.</p>
<p>And I am going to create this.</p>
<p>Now the reason why I say this is very well optimized is first off, I can change the depth of this landscape and you will see in just a second.</p>
<p>Oh, I forgot to add the material, but no probably we can add that later on.</p>
<p>It might take a while if especially if it's the first time for to set everything up.</p>
<p>But once you've had created this, this wait for a bit okay, you can now see this huge white cursor over here.</p>
<p>Let's change the brush size to something small.</p>
<p>You can see that I've selected it has automatically selected the sculpt part and I can basically add some depth to this map.</p>
<p>For example, I can create mountains over here and if I want to flatten it, I can select the flattened part and then completely flat smoothen this out and flatten this to do the reverse of Actually no.</p>
<p>Now this automatically selects the sculpt part here.</p>
<p>I can basically create mountains etc.</p>
<p>Smoother where it is pretty surface mount is more than sit out.</p>
<p>And you can see that the shadows start disappearing.</p>
<p>And it's kind of the opposite of sculpt mode.</p>
<p>Flatten makes the land as flat as possible.</p>
<p>So if I want to, like, add a river over here, I don't know if you guys are aware, but Unreal Engine has this amazing water system.</p>
<p>So if I want to add a component, not a river, that doesn't make sense, if I want to add a point over here, I can easily do that.</p>
<p>But the reason why I'm using landscape is because let me show you something.</p>
<p>Let's actually go all the way.</p>
<p>Let's cut this part over here.</p>
<p>And let me change the tool strength to like point four.</p>
<p>So it's faster, you can see that it does not render the graphics over here, because it does not have to like, I mean, why would I want to render all of my graphics is the depth, the complete height of this graphics over here, when the player is not going to see it? Right? It's all about optimization.</p>
<p>Now, this is also one of the reasons why you've seen in many games, if you have some collision issues, for example, if I don't have collision over here, and the player just sort of falls through the map, if you keep falling, you can actually notice that you won't be able to see the top of the level.</p>
<p>That is because of the optimization part of this landscape or whatever they using.</p>
<p>It applies to a lot different game engines.</p>
<p>It was very, very common in Grand Theft Auto, San Andreas, and also cyberpunk.</p>
<p>But anyways, that's pretty much why I'm using landscape.</p>
<p>So here and also because I can use the the sculpt feature here, let me just, I'm going to add some depth, I'm going to make this look like an actual ground so that it's not completely flat, I find that really boring I hate I hate when objects are completely flat.</p>
<p>So I'm just sort of going to do that.</p>
<p>And let's, so you can see that it's it's editing something called the height map, the height map essentially adds depth tells the map where how high.</p>
<p>The level is, for example, this coordinate my, I have like mountain of some sort.</p>
<p>And we here I don't.</p>
<p>So that's pretty much what it's doing, we're here.</p>
<p>Now if I want to go back to my SELECT mode, I can just simply click on my select modal here.</p>
<p>And that is pretty much it.</p>
<p>So if I select my landscape, I can change a lot of these values, what I'm gonna do is I'm actually going to create this again, because I didn't show you how to add a material.</p>
<p>So when you go to your landscape mode, you can see this material part over here, try to select the ground material.</p>
<p>And let's create it again.</p>
<p>And it's going to be 77.</p>
<p>So that's how you add material.</p>
<p>And again, I'm going to add some depth over here, just rub sound and make sure you have you click your mouse and just to wrap this around.</p>
<p>Okay, that is awesome.</p>
<p>Now they've created the landscape.</p>
<p>And also another good part about this landscape mode is that it scales the texture automatically for you so that it's not just, you know, one part of the texture, it sort of scales a lot.</p>
<p>So I really, really love that about the landscape.</p>
<p>So try to add some lights onto your landscape, try to experiment on your own to change the light, the color of the light or the intensity, whatever you want.</p>
<p>And that less and less, I think around the exponential height fog.</p>
<p>If I go all the way to the top, I could change the fog density to make this really foggy.</p>
<p>I want to give this a sort of Martian like, looks, I'm sort of gonna make that red in color.</p>
<p>And yeah, that looks really good.</p>
<p>Okay, now, let's get into the coding part.</p>
<p>But it's not exactly coding.</p>
<p>It's called something called blueprinting.</p>
<p>And that's the visual scripting language of Unreal Engine and I absolutely love it.</p>
<p>If you go to the Blueprints folder, you can see the third person character that says W tech.</p>
<p>Now remember, this does not mean you can completely get away with just blueprints.</p>
<p>You will need C++ if you're making a full fledged game and releasing it.</p>
<p>Why because blueprints are mostly meant for prototyping and small features.</p>
<p>If you if you have if you're trying to make a multiplayer game, for example, you can't get away with blueprints because blueprints is not exactly the fastest programming language.</p>
<p>It is also a programming language, but it's not fast.</p>
<p>C++ is a lot faster, which is why we're going to create the exact same game game in C++ later on.</p>
<p>But that is a different course.</p>
<p>This is only going to be blueprints as I explained before.</p>
<p>This might seem a little confusing for you, but actually these are two different windows And if I go to my viewport over here, I can see my third person character in action.</p>
<p>And I can see my collide, I can see all of my confidence altogether, like the camera, the error component, all of that, let's try to take a look at all of these one by one, they've always taken a look at the capsule component, let's take a look at the arrow confident this basically points towards the points to the front of me to the forward vector, or it points forward all the time.</p>
<p>They say look at the mesh, the mesh.</p>
<p>Okay, so now we have two different types of mesh in Unreal Engine, whereas the static mesh, and one is in skeletal mesh, the Static Mesh is used for stuff like, let's say, a cube, for example, if I drag this cube over here, you can see I have a static mesh.</p>
<p>That's mostly because this cube is probably not going to move and it does not have any extra animations.</p>
<p>Like, I mean, what am I going to animate out of cute, maybe I can make this fall, it's a champion, I don't need a skeleton, I don't need something called a skeleton for it.</p>
<p>But I have something called the Skeletal Mesh.</p>
<p>And this is the complex counterpart for the Static Mesh.</p>
<p>A Skeletal Mesh is essentially a mesh with something called a skeleton, the how animations are created is you have something called a skeleton and it's assigned to a particular mesh.</p>
<p>And you have the skeleton is of a bone and riddlin.</p>
<p>It's almost just like the human, the human skeleton over here.</p>
<p>Now, what how animations are created is i You take specific bone, and you sort of change the values.</p>
<p>For example, if I rotate this bone over here, activate an animation, I mean this for a second slapping someone, but that's pretty much how animations are created.</p>
<p>I manipulate the transform values of this of these points over here, like, okay, not the middle finger, maybe the index finger.</p>
<p>And yeah, there we go, I can do that.</p>
<p>So that's pretty much what animations, how animations are created.</p>
<p>Now you can create animations in Unreal Engine, but I'd suggest you to if you want to learn how to make animations, there are a lot of Blender courses online, by Game Dev TV, or anyways, there are a lot of different there's a lot of Blender courses online, please take a look at it.</p>
<p>It's amazing.</p>
<p>But this is the skeleton that unreal provides us with, I have something for the camera, boom.</p>
<p>Now, if I hover over it, this is the spring arm component.</p>
<p>And the spring arm component.</p>
<p>Essentially, the reason why we're not adding the camera directly is because if I have a wall behind, and if my if my character is moving behind him, if characters moving back like that, okay hadn't moved the capsule, I've actually moved the mesh, if I keep moving back and the camera moves with it, the camera might flip through the wall, I don't want that I want my camera to sort of move up as the wall as I'm getting closer to the wall, which is what Sprayground is used for it makes sure that you the camera doesn't move through the void.</p>
<p>Now the follow camera is that the camera itself and if you want to change the position add rather change the values of the target offset over here.</p>
<p>So five, Jesus like maybe 30, I mean 300, you can see moves with respect to the y axis.</p>
<p>So I do it that way, anytime.</p>
<p>So I'm going to if I want this hire, I can change the socket offset, and then press E change the rotation like that.</p>
<p>So that's the way to go when it comes to making a camera system.</p>
<p>And they have the character movement.</p>
<p>This is a built in component created by and created by Epic Games.</p>
<p>And this basically has different menus that you can manipulate, for example, the movement values, let's actually try to change these if I search for my walk speed over here, that's actually search for the maximum walk speed.</p>
<p>If I change this to like, let's say 350 over here.</p>
<p>And if you want your changes to get saved, you have to make sure you hit on the compile button.</p>
<p>And if I press Alt P, you can see that I am walking slower than usual.</p>
<p>So I can basically manipulate all of these values.</p>
<p>And this is again, you can see that is inherited.</p>
<p>So this belongs to the character class.</p>
<p>And this character class has all of these inherited so I can read any of these.</p>
<p>Let's, let's respect the 600.</p>
<p>But anyways, it doesn't matter because we're creating our own character.</p>
<p>The Event Graph is where you create your logic.</p>
<p>So these are all called nodes.</p>
<p>And you can basically drag and drop these nodes over here to create your flow of the code.</p>
<p>Don't worry, this is very confusing.</p>
<p>We'll be creating all of this from scratch.</p>
<p>Okay, and yeah, that's pretty much it for the Event Graph.</p>
<p>And if I go to my Construction Script This occurs even before the even before the game starts.</p>
<p>So if I want to add some functionality to my game engine, I can do that in the Construction Script.</p>
<p>In my event graph, I have my variables button.</p>
<p>Let's take a look at the graphs, I can get different graphs.</p>
<p>For example, I can create a new graph just a moment, if I want to keep this very, very tidy.</p>
<p>But we're not going to do that we have a very simple script, so that's fine.</p>
<p>And we have something called variables a variable is okay, I'm going to make a variable that a variable is basically something that can contain a value.</p>
<p>Variables can be of different types, floats, integers, integer 64, by double, let's take a look at all of these.</p>
<p>A boolean holds a true or false value by the snake bit number, integer is a number bigger than the byte integer 6464.</p>
<p>bit number float is a decimal number.</p>
<p>So that's like 3.14 10.6 6.9.</p>
<p>And double is a big 64 bit floating floating point numbers as far as like 6.999.</p>
<p>And and then try and keep going on until six bits of memory.</p>
<p>A name is a piece of text, or string is basically any single value that's in quotes.</p>
<p>For example, it could be my name, or the the word, the word hello, or the sentence Hello world, that could be a string.</p>
<p>A text as well, this is a different type of string used for UI, etc.</p>
<p>Name is mostly used for scene names, level names, all of that vector, a vector in physics is basically a value that has a magnitude and direction.</p>
<p>So I can say, x is moving at 10 to 10 meters square per second in my in the x direction.</p>
<p>So that's a vector.</p>
<p>And a vector consists of the X, Y and Zed values to theta is for rotation, and it also has the X, Y and Zed values that are transformed.</p>
<p>We've already seen it, it's the rotation, the rotation location and the scale.</p>
<p>It is universal for every single game engine.</p>
<p>So yeah, that is the basics for the blueprints.</p>
<p>Now let's go ahead and create our own character.</p>
<p>So I'm going to create a new folder first.</p>
<p>And I'm going to call this custom blueprints, because I will differentiate between the ones that Epic Games has created and the ones that I've created.</p>
<p>And it's very important to be organized.</p>
<p>Now.</p>
<p>Okay, trust me on this, every single game developer will ask you to be organized and they themselves will not be organized.</p>
<p>This happens all the time.</p>
<p>But it is best practices, you're just starting to learn.</p>
<p>Try, keep your project as organized as possible.</p>
<p>Now, over here, I have my desktop icons, hidden but if I showed you your policy, how old next time, make sure you don't make that mistake, try to organize your folders as much as possible.</p>
<p>And custom blueprints, I'm going to create a Blueprint Class, and this is going to inherit from my character.</p>
<p>So I'm going to have every single functionality that this character provides.</p>
<p>For example, I can walk around, I can add input the code, I have the ability to do that.</p>
<p>But I need to make sure I tell my character to move that's like you, you have the intelligence to make game.</p>
<p>But you need to learn how to make a game that's pretty much what we're doing over here.</p>
<p>So have a character, I can select that.</p>
<p>And the naming convention is usually DT underscore the name someone call this battery man.</p>
<p>And if I open it up, I don't have the mesh anything.</p>
<p>So if I go to my third person character and try to compare it all of these inherited parts, I have them on my VPN disco Batchi.</p>
<p>Man, I don't have the mesh because the mesh isn't I mean, I don't have the camera and the spring on component because that is not inherited.</p>
<p>So let's actually copy this and add them to our character over here.</p>
<p>Oh, actually seems like yeah, we can probably them coffee and paste them over here.</p>
<p>So I already have my camera added or you can just say Add Camera and add spring on component etc.</p>
<p>Okay, I have my camera, Compile and Save and let's assign our mesh.</p>
<p>So if I go to my mesh, I can go to my skeletal mesh.</p>
<p>I have only two of these.</p>
<p>I have the female and the male.</p>
<p>I'm going to use the male mannequin.</p>
<p>They're going to bring this all the way to the bottom by 80 units.</p>
<p>Actually, let's do 90 Actually, no, I think I think it would be fine over here and press E and let's move that by 90 degrees.</p>
<p>And again, that's the Zed axis companion save that style.</p>
<p>To run the game, you will notice that I still have my third person character.</p>
<p>And if you're still confused as to what character I'm using, you can inject from this character.</p>
<p>What does that mean? function, just press f8 in your keyboard.</p>
<p>And then you can the game is still running, but I can basically debug the scene over here.</p>
<p>Now if you select your third person character, you can see that I'm still using metal first character, my player since pawn.</p>
<p>And that sparks a question.</p>
<p>How does the game engine know without adding any functionality? How does this know that I am adding I want my third person character to spawn? That doesn't even make sense, right? The reason is because I have something called game modes.</p>
<p>If you go to Edit Project Settings, let's take a look at the maps and modes part.</p>
<p>Over here, I have something called Game Mode, the game would basically set default values for every single scene.</p>
<p>So I can say, no matter what scene I create, I always want my third person character to spawn.</p>
<p>And in that scene, I can say for example, if it's the main menu, I can have an override game mode, which says, Okay, for the main menu, don't spawn the character, because that's weird.</p>
<p>So I'm going to just have my UI, etc, I don't want my character to respond.</p>
<p>So that's how Unreal engine works.</p>
<p>So over here, on my default game mode, I'm going to change this value to BP underscore Batman.</p>
<p>And now if I press Alt P, I can see over here, but obviously, I don't have any functionality.</p>
<p>The reason is, because I have the ability to take input, but I haven't done anything with that input yet.</p>
<p>So that's what we're going to add over here.</p>
<p>If I go to my event graph, let's actually take a look at all of these events over here, which we haven't seen before.</p>
<p>I'm going to remove these.</p>
<p>Okay, now, the event claim, let's actually see what this does the event play event, it executes whatever code that's attached to it in the beginning of the game, so only one is going to get executed once and that's when you begin playing the game.</p>
<p>Even take it gets executed every single second.</p>
<p>And let's actually take a look at an example.</p>
<p>If I drag this over here is called the exec node.</p>
<p>And I can release it to play to place a new node.</p>
<p>And I can just save print string over here.</p>
<p>The way this works is, when I call begin play when they implement is called automatically and that time is going to print out the string over here.</p>
<p>And I'm just going to say this is they can play compile, and let's play the game, Alt P.</p>
<p>And you can see that says this, this is being played.</p>
<p>Now, I'm going to add Player Start at the play style essentially defines where my player stood bed, my ventilation stopped the game.</p>
<p>So now I don't fall off the map.</p>
<p>So notice this is big and played.</p>
<p>I'm going to now press Alt and click this button over here.</p>
<p>And then move on move this to the bottom, and then drag the event take note over here.</p>
<p>Now this can be anywhere.</p>
<p>But I'm just I just asked you to get it bring it to the bottom because I want this to be neat.</p>
<p>So Compile and Save on dpi.</p>
<p>And now you can see that printed every single frame.</p>
<p>Now remember, this might be different for every single computer.</p>
<p>If my game runs at 60 frames per second, this function will be called 60 frames per second.</p>
<p>But in a different person's computer, let's say you have an RTX 13 3080.</p>
<p>And your game runs at like 160 frames per second 120 frames per second, then this function will be called at 100 120 frames per second.</p>
<p>That is how the tick function works.</p>
<p>For unity users.</p>
<p>This is like the start and the update functions.</p>
<p>Very, very similar.</p>
<p>So we're not actually not going to use any of these because what we're going to do is we're going to say if I press my W key or my s or my A or my D, do me move the character and if I press let's say my mouse button, print something out, that's what we're going to say over here.</p>
<p>So if I minimize this window, go to Edit Project Settings.</p>
<p>I have my input part over here.</p>
<p>I have two types of bindings over here.</p>
<p>One is the action binding action mapping and once the Axis Mapping action mappings are pretty self explanatory, I just have my spacebar over here.</p>
<p>I'm actually not going to bother adding bank our game does not have any jumping mechanics over here so we're not going to add any jump but I'll actually show you how to make your player jump.</p>
<p>So this basically says if I if I'm basically if I go back to my blueprint, right like and Jump event.</p>
<p>You can see under input action events, I have this jump, and this button, my press my button, press my jump button, do something, press.</p>
<p>If I release my jumper do something, I was the jump button.</p>
<p>The jump button is my spacebar.</p>
<p>And for my gamepad, it's my face, pop, pop bottom.</p>
<p>But anyways, I'm going to name all of these Unreal Engine, obviously, it seems like it supports a lot of different consoles, which is awesome.</p>
<p>And my access mappings, this gets a little confusing, I'm going to remove everything I'm not going to use again, because it gets very confusing for new developers.</p>
<p>So I'm going to do more of these.</p>
<p>Now, if I press W, I want to return a value of one, which is basically going forward.</p>
<p>If I press S, I want to return a value of minus one.</p>
<p>And if I press A, I want to return a value of minus one, if I press do moderate on the value plus one, why? Because take a look at the axis.</p>
<p>If you go forward, it's usually positive.</p>
<p>If I go backward, it's negative.</p>
<p>So to my movement input, I'm basically going to say add one, two, as long as I'm pressing my W button, add one to my movement input.</p>
<p>And if I press a it's going to add a value of let's say minus one at that particular direction.</p>
<p>So why is it Why is a minus one, well take a look at the x axis.</p>
<p>If you look at the x axis, the left part is minus one, the right part is supposed to one.</p>
<p>So that's basically how the coordinate system works over here.</p>
<p>Turn rate, what we're going to do over here is I'm actually going to delete our turn, rate and turn and our lookup rate over here.</p>
<p>And what we're going to do is, instead of this, we're going to call this look tight, and then we'll call this look up, look up is your mouse by direction, it returns a value ranging from minus one and four look right, if I move my mouse in my x direction, it returns a value ranging from bots to one, let's actually see what that does.</p>
<p>Now, in my input action, if I press this, I want to print I am jumping.</p>
<p>So I can just say control me Compile, Save that go back, I can remove this now, and all failed.</p>
<p>If I press space, it says I have sheltered and if I release this, if I go to my release part over here, I it's only going to print this out when I release my important.</p>
<p>Okay, now, let's try to bind all of Les I ran in said add some functionality.</p>
<p>If I right click and then search for mouse X, make sure you get the event the the events and not the mouse values.</p>
<p>So I'm going to get mouse X and mouse vi the events.</p>
<p>So let's actually see what I mean by when I say it returns a value ranging from minus one.</p>
<p>So what I'm what I can do is from this node, I can print a string.</p>
<p>And this is a float, the green part is for float, what this is doing is it's giving an output of or returning a value of a float, which is the axis value.</p>
<p>And if I drag this end, it's going to convert a float to a string.</p>
<p>If I compile and save, go back, Alt P, if I move my mouse, left and right, actually, that was more sex, yes, so that's going to be left and right, you can see my values are ranging from one to minus one.</p>
<p>I mean, that starts from one, if I go right, it's going to be positive, it's going to go if I go left, it's going to be negative, it just keeps adding that value over here.</p>
<p>And the same goes you can try this out for more spy, I'm not gonna waste everybody's time trying to do the same thing for most pilots will do the same thing.</p>
<p>Okay, so let's actually try to add our mouse movement over here.</p>
<p>If I go to my spring arm, I have to make sure it always has used pawn control rotation.</p>
<p>why? It's because when I change when I what I'm going to do is I'm going to change the control rotation of the phone.</p>
<p>And that's how I'm going to change the rotation of the spring arm which changes the rotation of the camera.</p>
<p>Why? Because the camera is the child of a spring arm.</p>
<p>What that means is that if I move my spring on the camera is going to change with it just like how a kid follows his or her mom all the time.</p>
<p>That's basically how the spring in the painting part works over here.</p>
<p>Same way the arrow is a child of the capsule component the mesh is the child of capsule, etc.</p>
<p>which means as a moment capsule permanent the mesh moves with it.</p>
<p>Okay, so we're going to change something called the yaw and pitch, the pitch is the y axis the yaw is the Zed axis.</p>
<p>So with this axis value basically add that value to the Y or the Zed axis.</p>
<p>Let's see how to do that.</p>
<p>That's dragonoid.</p>
<p>And we're going to search for it.</p>
<p>If it's the x axis, we're going to add the your to it.</p>
<p>Why? Because the x axis, if I'm going to rotate with respect to my x axis over here, that means I'll be rotating it, you know, sideways, I don't want that, right.</p>
<p>So I'm basically rotated with respect to the set axes, which is basically left and right.</p>
<p>So I can plug in this value over here, copy, I mean, I'm not gonna copy that, I'm just going to do the same thing, but for the pitch over here, so add controller pitch input.</p>
<p>Now, keep in mind, if I have this disabled, so all 10 like that, if I don't have an exit node connected, it means this, this function will not get executed, what is the function of function is a chunk of code, which may or may not take an input, and it provides an output based on that by processing it.</p>
<p>So you have an input, it processes that input, calculates that does something and then provides an output the output here being the camera, getting the camera rotating on the scene.</p>
<p>So if I go back, Alt P, you can now see that I have proper camera movement over here.</p>
<p>Now, if your axis is inverted, like for example, if I go up, I want to go down.</p>
<p>And if I move down, I want to go up, if I want to do that, all I have to do is go to my project settings again, go to my input part, and I can just change my mouse vide positive one.</p>
<p>And if I alt v, now, if I move, if I move up, I mean, it just does the opposite, essentially.</p>
<p>Okay.</p>
<p>Let's open up the blueprints, again, where we we did this for our mouse, but we need to add movement, obviously, to it.</p>
<p>So let's do that.</p>
<p>Now let's get on events.</p>
<p>So our move forward event was basically binded to the keys W and a I mean, W and S.</p>
<p>So let's search for the access event over here.</p>
<p>And let's do the same for move right, the X event.</p>
<p>So I have the x value over here, for move forward, I'm going to add this axis value to something called the forward vector of the character, the forward vector is basically a vector that defines the forward direction.</p>
<p>And here we're going to add this to the right vector.</p>
<p>The right vector is essentially the the vector that defines the right direction.</p>
<p>So if I right click and add movement, or if I search for this, I need the world direction over here.</p>
<p>The whole direction is that basically we get actor.</p>
<p>Let's actually get the rotation over here.</p>
<p>So if I drag this over here, get rotation, okay, get location, get forward vector.</p>
<p>So this is going to get this direction is going to be the forward vector, because we're going to, we're either going to move forward or back.</p>
<p>And this takes an input asset rotation.</p>
<p>Now, this is a variable, the forward vector is a variable.</p>
<p>And it's if I mean, there's a function, the forward vector itself is available, this get forward vector is a function.</p>
<p>And this does not have an exec mode, which means it's a pure function, it returns a vector, and I can add that to the world direction, the scalar value is going to be the intensity, which basically whether if I press W, it's going to return a positive value, the press S, it's going to return a negative value.</p>
<p>And N rot is basically the rotation, I'm going to get actor rotation here.</p>
<p>And so basically, what it's doing is basically doing some complex math, and then saying, Okay, I know what the forward vector is.</p>
<p>So move, depending on that direction.</p>
<p>Now, the same thing over here, and movement and foot, but there's going to be for the right vector.</p>
<p>So get right vector.</p>
<p>And we're again going to use the actor's rotation over here.</p>
<p>So that's that for our movement.</p>
<p>And that's pretty much it.</p>
<p>We're done with movement.</p>
<p>So if at all fee now, I can move left, right, forward, back, etc.</p>
<p>And it works perfectly fine.</p>
<p>But my character is still in this V pose, or this T pose.</p>
<p>The reason this because I don't have any animations assigned.</p>
<p>Before that, let's actually see how to make this neat.</p>
<p>Now, okay, the length of this node or this length, the length of this line does not matter.</p>
<p>It's not it's not going to affect the speed at all.</p>
<p>Just just adding that I was dumb enough to believe the speed was affected.</p>
<p>Because of it.</p>
<p>Don't be like me, it's not.</p>
<p>But always make sure it's neat.</p>
<p>Make sure you can see which line which axis, I mean, which way was getting connected to what etc.</p>
<p>That is very important.</p>
<p>So Compile and Save.</p>
<p>Now let's start, let's send a document our code over here.</p>
<p>If I select all of this, and press C, I can add something called a comment.</p>
<p>This does nothing but it's just for us for our understanding.</p>
<p>So I'm just going to say add Movement Input over here, and over here on the screen to see add mouse input here.</p>
<p>Now, we're not going to have, we're not going to make a character jump, but in case you want to add the functionality, I'll show you how to do that.</p>
<p>If I right click and search for the jump event.</p>
<p>So remember, we have an action action event called Jump.</p>
<p>Very impressed this I want to start, I want to just jump and jump is a built in function of this character class.</p>
<p>So the character automatically starts jumping.</p>
<p>And over here, I can say Stop jumping, because I don't want to keep going higher and higher and higher.</p>
<p>So all three, I have my jumping over here to person.</p>
<p>But I'm not going to bother adding this because I don't want this in my game.</p>
<p>But yes, that is that for movement.</p>
<p>Now that they've added movement, the next part is to add animations.</p>
<p>A lot of people don't like animations.</p>
<p>I personally don't like adding animations.</p>
<p>But unfortunately, it is a part of game development.</p>
<p>So let's dive in on how to do that.</p>
<p>For animations, I have a different blueprint that I can add.</p>
<p>So I'm going to make content part and new folder.</p>
<p>I'm going to call this animations.</p>
<p>And let's create something called an animation blueprint.</p>
<p>Now the reason why we using an anime Animation Blueprint, not the normal blueprint is because the Animation Blueprint is optimized specially for for blueprints and before animations, and it has a lot of different functions built in.</p>
<p>Now, to create an animation blueprint, I have to attach this or assign a skeleton to what we've already seen what a skeleton is.</p>
<p>So different animations are made for different skeletons.</p>
<p>So make sure we select the YUI for manikin, which is the built in skeleton, press OK, the naming convention is AVP.</p>
<p>Oops, again, right click Rename a BP underscore, I'm just going to name this battery man over here.</p>
<p>Double click.</p>
<p>And now I have my output pose, I have two different graphs.</p>
<p>So here I have something called the Adam graph, which basically decides the output post and in the event graph, I can, let's say get the speed of the character and then change the animations based on that.</p>
<p>That's what these two graphs to the Event Graph is for all the functionality like um, getting the variables adding values to the variables, etc.</p>
<p>The enum graph is to decide the output pose.</p>
<p>If I drag a node from here, and search for the run animation plate or person run and compile.</p>
<p>Now, this over here takes an input if your if your variable is on the left side, it means it's taking an input.</p>
<p>If it on the right side, it means the node is giving an output.</p>
<p>So the third person is going to get the animation, use the animation pose as an output.</p>
<p>And that output is sent as an input to this output.</p>
<p>So here, component save, I had to go to Batman and assign my animation blueprint.</p>
<p>So I can either select my animation blueprint and then hit this arrow over here.</p>
<p>Or I can just search by a BP underscore batch command.</p>
<p>Now Compile and Save.</p>
<p>If I run this now, you can see that my animation is getting played continuously.</p>
<p>I don't want that I want that idle animations, all of that.</p>
<p>I want a different animation for strafing, it just looks really weird.</p>
<p>So we're going to create something called a blend space for that.</p>
<p>Let's take a look at what blend spaces.</p>
<p>So good animation.</p>
<p>And so it's for blend space.</p>
<p>And again, you have to assign the skeleton.</p>
<p>So this will be BS underscore battery man.</p>
<p>Okay, now, let's open this up.</p>
<p>And this might look a little confusing, but essentially, the Blendspace has the x axis and the Y axis.</p>
<p>And depending on the values of this, also a certain animation will be played.</p>
<p>For example, let's take a look at the vertical and the horizontal the vertical.</p>
<p>I think the vertical is this one over here.</p>
<p>Yeah, that's the speed.</p>
<p>So that's vertical axis, we're going to name this the speed and in the bottom on the horizontal axis the direction.</p>
<p>So based on my direction and my speed, I can play a particular animation.</p>
<p>So my minimum speed over here is going to be zero, my maximum axis value over here, my maximum three, the 600.</p>
<p>As we set in our movement component, a minimum axis value here is going to be 180.</p>
<p>by Paul maximum is going to be first a 180.</p>
<p>So Y, first 180.</p>
<p>And next 181 80 is usually forward, negative 180 is the complete opposite direction.</p>
<p>So that's what we're doing over here.</p>
<p>Okay, so basically, what I'm saying is, actually, let's do this with an example search under this Asset Browser source for your idle animation, and drag and drop this at the bottom.</p>
<p>What I'm saying here is, if my speed is zero, regardless of my direction, make sure you play the idle animation, I'm pretty sure you can now understand what this is doing.</p>
<p>So if my speed is zero, then I'm going to play my idle animation.</p>
<p>Now you may understand where to put your run animation, it's going to be all the way at the top.</p>
<p>Now, if you hold Shift, and actually sort of move around, you can actually you can preview the animation.</p>
<p>So if my speed is set, if my direction is at zero, which is forward, and my speed is at 600, then I'm going to play that animation.</p>
<p>And it's slowly trances rate slowly adds the value.</p>
<p>So my animation slows down as I go down.</p>
<p>And my preview value, if my speed is at zero, regardless of my direction, I'm still going to stay idle.</p>
<p>So that's what it does.</p>
<p>If my direction is at 90, I want I want to make sure I move left.</p>
<p>So let's search for that search going on, experts take a look at all families over here.</p>
<p>Okay, so they would usually happens is we have different animations for when the character turns left, and when the character on site.</p>
<p>But the animation, the animations that come built in, we unfortunately don't have those animations.</p>
<p>So what we're going to do is we're just going to add run over here.</p>
<p>And remember, when my direction is at, usually, you'll have also a backward run animation.</p>
<p>So when the direction is at minus money at MIT, you usually want your the want to move backwards, so you have different animation for that, and you will add that, respectively.</p>
<p>So that's just add this animation, I really don't want to do this.</p>
<p>But in our C++ course, I'll make sure we get animations for moving right moving left, actually, let's try deleting the all the other values, let's just have one for moving forward.</p>
<p>If I save this, and all be okay, obviously, I need to assign this Blendspace in the animation token, because we still haven't assigned it yet.</p>
<p>So if I go to my animation blueprint, I can drag a node and search for Blendspace.</p>
<p>So now I can see my Blendspace vs underscore Batman.</p>
<p>And this takes in two inputs, one is going to be the direction one is going to be the speed and based on that it will choose an animation, which is what we set.</p>
<p>So from here, I'm going to drag and load and promote this to a variable.</p>
<p>So it automatically creates a variable called direction and it's a float.</p>
<p>And I'm going to promote this to a variable and it's going to be speed, compile, go to my event graph.</p>
<p>Now in my event graph, I can get the speed and the direction.</p>
<p>So let's see how to do that.</p>
<p>Now from tie get pawn owner, what this does is it tries to get the owner of this animation blueprint.</p>
<p>So I can now cast this to my BP battery man, why am I doing this, but that's actually that's mainly because I have my point upon is the class but I have to convert my class to my battery man.</p>
<p>The way this works is if I go to my BP underscore battery man and add a variable, I'm just going to call this test variable.</p>
<p>And I want to get hold of this variable.</p>
<p>I can't get this from porn, I can just say get test variable, it does not exist.</p>
<p>But if I convert this to a Batman, and then as Batman, if I try get test variable, now I can get hold of the very variable.</p>
<p>So we're trying to just localize our localized this pawn to my VPN scope actually, man.</p>
<p>So from here, we're going to actually first what we're gonna do is we're going to check to see if we got our foreign owner or not, and that is done using the S valid node.</p>
<p>So if I Get my point honor, if if I'm not able to get my point or I can just say, I can just print a string saying I porn on are not valid.</p>
<p>Now the reason why we're doing this is because of attorney get a few variables from the point honor the to make sure we have that pawn owner, if not your game is and up your game is going to crash to this the safer way of doing it.</p>
<p>If it is valid, what we're going to do is we're going to cast to third cast to PP underscore Batman.</p>
<p>And this has an exec node.</p>
<p>So obviously this goes to as valid.</p>
<p>As Batman, what I'm going to do is we're going to get a variable called get velocity.</p>
<p>So the velocity is obviously the speed.</p>
<p>But remember, velocity has direction, and magnitude.</p>
<p>So from get velocity, we're going to get, we're going to calculate that you're going to get the that we're going to get the vector length, the return value is going to be your speed.</p>
<p>So we already we already promoted this to a variable.</p>
<p>So we're going to set this variable here.</p>
<p>So drag this variable onto your event graph and press Alt, and then you can just drag the return value on to speed which means now the value of the speed is going to be the velocity, the vector of velocity from battery man, we'd obviously set the direction to we're not done yet.</p>
<p>So from here, we're going to get actor rotation.</p>
<p>And from the rotation, we are going to calculate direction.</p>
<p>So obvious for the direction you need to calculate what you need calculate the velocity.</p>
<p>So from the velocity, you get something called the direction to that's how vectors work.</p>
<p>And again, I'm going to the same direction.</p>
<p>And I can set the value.</p>
<p>After setting speed, I'm going to set the direction.</p>
<p>So the control flow is basically update animation.</p>
<p>This is basically going to happen every single frame.</p>
<p>From here, it's going to go to S valid, it's going to check if the pawn owners valid, if it is cost to pvns, go battery man.</p>
<p>So convert porn to Batman, from here, get the velocity Get Actor rotation, calculate the vector length, calculate the direction, set the speed and then set the direction, we can actually then keep this over here.</p>
<p>Now we have the values for speed and direction, all you have to do is go to Anam graph, and you can see that it has already set the direction and the speed.</p>
<p>So now Compile and Save, go back.</p>
<p>And if you press ALT T, I now have my animations.</p>
<p>Obviously, it does look a little weird that if I go left and right, I don't have proper animations.</p>
<p>But that's actually going to be actually try to do this on your own search for your left and right animations.</p>
<p>Go to your go to this namespace.</p>
<p>When your direction is at minus Canadian 180, you want to make sure the character goes backwards.</p>
<p>And for left and right animations here, you're going to place your right animation here, you're going to press your left animation and check if it works.</p>
<p>And if it does, then you understood how blend spaces work.</p>
<p>But we're gonna move on the game.</p>
<p>As you've seen at the beginning, the way the game works is you have a lot of different batteries all around the map.</p>
<p>And the health of the player keeps decreasing.</p>
<p>And you have to make sure you collect all of these batteries.</p>
<p>And if you do, then you go to the next level or you win the game.</p>
<p>So let's see how to do that.</p>
<p>This is where we'll be learning about UI, etc.</p>
<p>So that's going to be there's going to be the second part of the course.</p>
<p>If I go to my blueprints, method person actually not method freschetta.</p>
<p>Obviously, it has to be my AVP underscore Batman, I mean, my btn school Batman over here, we're going to create a new variable called Health.</p>
<p>Let's remove this.</p>
<p>And let's create a health variable.</p>
<p>Over here, I'm going to search for now I'm going to make this a float and compile the default value as the default value.</p>
<p>And what's going on with me the default value is going to be 100.</p>
<p>Compile and Save.</p>
<p>Now, what we're going to do is we're going to get our event tech and every five seconds we are going to reduce the health.</p>
<p>How do I do that dragon node and then add a delay over here.</p>
<p>What this does is it's basically going to wait for X amount, they're going to wait every five seconds and get this value.</p>
<p>So if you Jacqueline's funny on the screen and then hit Ctrl, and then place it you will get, you'll be able to get whatever value your health is.</p>
<p>And we're going to subtract.</p>
<p>So if I just be, as you can see, if I search for minus, I can subtract a value, and I'm going to subtract a value of mine of five maybe.</p>
<p>So once I've subtracted the value, so let's say my health is 100.</p>
<p>If I subtract it, the output is going to be 95.</p>
<p>And I have set over here, again, set whatever value I've returned.</p>
<p>And then once I'm done, I can just do that.</p>
<p>Now, basically, every five seconds, I'm going to reduce my health, let's print my health out.</p>
<p>Actually, for simplicity, I mean, just make sure it's faster, I'm going to make it every two seconds, and drag and drop health, again, converted into a string and plugged into my friend strength file and save it.</p>
<p>Now you can see it's 100, after two seconds, 95.</p>
<p>And then it's 9085, etc.</p>
<p>So it keeps going down.</p>
<p>What I'm going to do is, I am going to add some UI, I'm going to add a health bar so that this is connected to that, I'm going to reduce my health every two seconds, but I'm going to reduce my health by 10, Compile and Save.</p>
<p>Now, I have to do something called binding, I'm going to bind this house to my UI.</p>
<p>So let's take a look at how to create UI.</p>
<p>Under blueprints, I'm going to create a new folder and call this UI.</p>
<p>And under UI, you can go to FX, I actually not effects.</p>
<p>This is not a user interface.</p>
<p>And I'm going to create a Widget Blueprint, the naming conventions W BP underscore whatever name I'm going to call this player UI.</p>
<p>So in this, we have something called the designer and the designer, this what the UI is going to look like you can design me, you can basically place all of these objects, and you can make it look like a proper UI, we're going to add something called a progress bar over here.</p>
<p>Let's actually scale this about let me make this 500.</p>
<p>And I'm going to do something called anchoring.</p>
<p>What this means is as I resize my screen, so for example, if I minimize my screen, I want my, I want this to still stay at the top left corner.</p>
<p>And if I make it fullscreen, it should move along with the screen.</p>
<p>That's what anchoring means.</p>
<p>So I'm going to make sure that it's over there.</p>
<p>And if I scroll all the way down, under style, I have something called the Fill image.</p>
<p>If I, if I'm, if I drop this down, I have something called the 10th.</p>
<p>The first image is going to be the actual health over here.</p>
<p>So I'm going to make sure my I mean my battery, my battery is going to be green, that actually reminds me how to change this to battery not here.</p>
<p>Okay, and make sure you save that here and compile.</p>
<p>And over here, our background image, let's just make this actually let's make that black, that's fine.</p>
<p>And we have to we have something called the percent.</p>
<p>Now the person ranges from zero to one, if it's one is going to be completely filled.</p>
<p>If it's zero, it's going to be empty.</p>
<p>Let's make the default full.</p>
<p>And we're going to do something called binding it.</p>
<p>So you see this bind button, and you can select Create Binding.</p>
<p>And what we're what we're going to do is we're going to get the health and we're going to set that health to this percentage, we're going to convert the health into percentage, and then we're going to set it over here.</p>
<p>So the return value is going to be the percentage that's displayed.</p>
<p>So now we can say Get Player Character.</p>
<p>And that's going to return whatever character I've possessed the good RBC convert this to my Batman.</p>
<p>So once we've done that, as Batman, we can just get our health and get battery.</p>
<p>And then we can set that over here.</p>
<p>But remember, we have to convert this into percentage because this person is going to be between zero and one.</p>
<p>So what we're gonna do is we're going to divide this by 100.</p>
<p>Remember by by definition percent means per cent cent is 100.</p>
<p>So, we're going to divide this by 100.</p>
<p>And then Return it over here, Compile and Save.</p>
<p>Now, we have to add this UI on to the screen.</p>
<p>To do that, let's go to bed, let's have our begin play, all the UI will be instantiated in being in play.</p>
<p>Over here, we're going to create a widget.</p>
<p>So we're going to create an object of this player UI.</p>
<p>So I need to select which class, that's going to be my WP player UI.</p>
<p>And return value, I'm going to add this to Viewport.</p>
<p>So it's basically to add this player UI on the viewport and whatever function binding, it's going to make sure it executes all of that code.</p>
<p>So now if I play, you can see that my percent bar is slowly decreasing, which is amazing.</p>
<p>And it has some amazing decal, too.</p>
<p>So it has some animated graphics.</p>
<p>So that's very cool.</p>
<p>As well, um, Unreal Engine, it does everything for you.</p>
<p>And we can now remove this frame string.</p>
<p>Now, again, we have to make sure it only reduces the value until it costs zero.</p>
<p>And once it goes to zero, I want to kill my player.</p>
<p>So to do that, first off, we're going to decrease the value only if my battery is more than zero.</p>
<p>So if I drag control, we now can search for the greater than symbol.</p>
<p>And if it's greater than zero, only then execute this.</p>
<p>But how do we do that? How do we add conditions, we do that by something called a branch.</p>
<p>So you can see that red color over here.</p>
<p>So if it's more than zero, it's going to return true.</p>
<p>If it's less than zero, it's going to return false.</p>
<p>So from here, I can create something called a branch.</p>
<p>And I can now add this to this branch.</p>
<p>Now, if my health is more than zero, then I'm going to execute this.</p>
<p>So I'm going to move that to the top.</p>
<p>If my health is less than zero, then I'm going to say my player is dead.</p>
<p>So that time I'm going to add a retry screen etc.</p>
<p>And I'm going to make sure I do not possess this character anymore.</p>
<p>But we will see that later on.</p>
<p>But let's create a variable.</p>
<p>Now.</p>
<p>Let's say B is player that's a naming convention for bool boolean values, you make sure it's B is clear that or whatever.</p>
<p>And we're going to make sure this Boolean compile, and the default value is going to be false.</p>
<p>And if I hold Alt and drag this onto the scene, we can set this to be true over here.</p>
<p>Awesome.</p>
<p>Now, if player is dead, then obviously, I've lost so I'll use a pull out menu screen menu.</p>
<p>And I can either retry the game, or I can play the game again.</p>
<p>So that is the basic functionality that we're going to use over here.</p>
<p>Once the player is said, what we're going to do is we are going to we have this function called detach from controller pending destroy.</p>
<p>What this does is it makes sure your controls don't affect the player once you have detached from once you're dead.</p>
<p>So if I wait and wait for it's actually let's let's make that faster, have no patience, I'm going to make that 20 so that as soon as I spawn in like four seconds, I end up dying.</p>
<p>So that's there.</p>
<p>And now you can see that you can try controlling, but you will notice that your controls don't work.</p>
<p>And that's because we have detached from this controller.</p>
<p>And we need the animation to stop playing.</p>
<p>So we can we can also have another so we can we can either stop our animation like this, but this might not work.</p>
<p>Let's try that out.</p>
<p>Let me make that funny because I don't want to wait four seconds, Compile and Save.</p>
<p>All pay.</p>
<p>Now the animations are still playing.</p>
<p>So we have to take care of this through the Adam montage.</p>
<p>I mean the animation blueprint, we have this variable here is player dead.</p>
<p>So we're going to get this variable from our BP battery man.</p>
<p>And if it's true, they're going to stop animation.</p>
<p>So let's see how to do that.</p>
<p>We'll be learning about a new thing called the blend by blue.</p>
<p>Yeah, the Blendspace by blue.</p>
<p>Okay.</p>
<p>Over here in this enum enum graph we've seen before that we have something called a branch.</p>
<p>So if the condition is true, do this condition is false to that.</p>
<p>Instead, what we'll do is we'll say, just search for both answers blends poses by bool.</p>
<p>then post this by blue.</p>
<p>Okay, anyways, if so we can pass in a bool value over here.</p>
<p>And if it's true, it will do this.</p>
<p>If it's false, we'll do something else.</p>
<p>Now, if a player is not dead, we want this Blendspace.</p>
<p>If the player is there, then we can just, maybe I know, we can play the idle animation over here.</p>
<p>And how do we get this value? Same way, we have BP battery man, they can also say get the S is player that and we can promote this to a variable.</p>
<p>So promote the variable and bring this all the way to the top and compile.</p>
<p>Now I think you can understand the rest, we can just drag and drop this over here.</p>
<p>And now it's going to make sure if there's dead then just want to play the idle animation and not do anything because we don't have fuel to run.</p>
<p>There we go.</p>
<p>That works perfectly fine.</p>
<p>And after this, we have to make sure we display our player Lua screen.</p>
<p>Now try to do this on your own, it might be a little difficult, but just give it a shot.</p>
<p>If you can't, no problems we're going to do anyways, we're going to create a new user interface, we're actually going to create two of them.</p>
<p>One is for player when one is for player two is.</p>
<p>So we WP underscore.</p>
<p>Actually, we don't need a blueprint of Widget Blueprint for when because we're automatically just going to go to the next level.</p>
<p>Or we're just going to have it is going to go to the next level.</p>
<p>And here we can just name this the BV WPP Lu screen and the designer part.</p>
<p>I'm going to add an image first, let's scale this completely, so it fits this handle.</p>
<p>And make sure we have this properly aligned.</p>
<p>Okay anyways, even if it's oversized no problems, we're going to anchor this to be full screen.</p>
<p>There we go.</p>
<p>So it's going to be it's going to make sure it's always full screen.</p>
<p>And I'm going to change the opacity to I'm gonna change the color to black and the F two like that.</p>
<p>That looks fine.</p>
<p>We're going to have two buttons now.</p>
<p>The first button is basically going to be one sec.</p>
<p>Give me a second Okay, the first button what it's going to do is when there's when the the retry part, so retry game, and need to add some text to it.</p>
<p>The same button, I can do the cater.</p>
<p>And they're going to add this over here.</p>
<p>I know it's not exactly aligned, but that's fine.</p>
<p>This is going to be quit aim want to quit color and opacity seems just fine for me.</p>
<p>Yeah, that's that seems just fine.</p>
<p>No problems.</p>
<p>Okay, now let's see how to add text to this, all you have to do is search for text and drag and drop it, it's going to automatically pair it make this a child.</p>
<p>And either the text block over here are going to save the try game.</p>
<p>Or actually usually just as we try.</p>
<p>And on the phone, I'm going to change the size to maybe 34.</p>
<p>That seems fine.</p>
<p>And for quick game again, another text block, they're going to make it 3042.</p>
<p>And we can just say quit.</p>
<p>Game nation, I'm gonna name this text block to quit text.</p>
<p>And this one is going to be retry.</p>
<p>And we're going to have a huge block of text over here.</p>
<p>And this one, we're going to name it.</p>
<p>We're just going to say you do is that's that's pretty much it.</p>
<p>Let me make that 80 actually living and textbook I'm just saying I'm just going to say you Louis.</p>
<p>Okay, awesome.</p>
<p>In my graph, I have to make sure I add functionality to this to these buttons.</p>
<p>So if you scroll all the way to the bottom after you've selected the button we have on click and on press, we're going to use the on pressed because it works better for example, if you press enter by mistake it might just end up retrying again, we don't want that we have to make sure we click on the button.</p>
<p>So that's why we use on pressed do the same for retry game to I mean for quit game.</p>
<p>Not on flick on pressed over here.</p>
<p>And for retry, they're going to open We're going to load the level, we're going to load the exact same level.</p>
<p>So that level is going to be get level get current level name.</p>
<p>Because if it's a different level, if it's level two, then it has to make sure it has, it opens up that level.</p>
<p>So get current name ensures it gets the proper level, the level that you're running right now.</p>
<p>And we're going to open that level.</p>
<p>So it's basically to open the same level, again, all the default settings for quit game, it's literally just one node, quit game.</p>
<p>That is it, Compile and Save.</p>
<p>Now if I minimize my screen called P, again, we have to make sure we add it to Viewport.</p>
<p>So if I go to my blueprints, if my player is that detached from controller pending, destroyed, that's fine.</p>
<p>And whatever we did here, we're doing the exact same thing over here.</p>
<p>But the problem is, remember, this is on tick.</p>
<p>And when we create, when we put this on tick, it means it's going to create the player widget every single frame and add it to Viewport every single frame, which means your game might end up crashing.</p>
<p>So we're going to add a note that says do once.</p>
<p>This means that it's going to whatever that comes after it's going to do this only once.</p>
<p>They're going to burn to make sure we recreate the loo screen widget, and then we're going to Add to Viewport.</p>
<p>Now if we compile and save it, let's run the game.</p>
<p>And now it says he lose.</p>
<p>But the problem is we cannot use our mouse, we can only you know we have to press windows etc.</p>
<p>So if you want to show the mouse cursor, get your Player Controller anything related to controls that's present in the Player Controller, and over here, search for cursor.</p>
<p>Let's see what we have over here.</p>
<p>We have get Show Mouse Cursor Set Show Mouse Cursor.</p>
<p>So we can set this by this value is present in the Player Controller, we can set this to true after Compile and Save this and minimize.</p>
<p>And we're running around.</p>
<p>And now I can see my cursor.</p>
<p>If I press retry.</p>
<p>It loads the same level again, and I'm losing and blah, blah, blah.</p>
<p>So it basically restarts the level.</p>
<p>Okay, awesome.</p>
<p>We've done all of that.</p>
<p>Now let's see how to convert these into functions.</p>
<p>Functions are basically blocks of code made into one chunk of an object, which you can call later on.</p>
<p>For example, if I right click on all of this collapse to function, collapsing the function fail, let's see why is that okay? Delay cannot be okay, some.</p>
<p>Okay, let's just create a test function over here, test function.</p>
<p>So this function can have a lot of different functionality.</p>
<p>For example, imagine I have 1000 nodes in this graph over here, forgot to even graph if I'm, if I want to call this function again, like in 10 different positions.</p>
<p>What if it makes better sense for me to call this function rather than creating those 1000 nodes again, and again, and again, that's going to look very, very dirty, which is why I'd rather put those 1000 function those 1000 nodes in one function, and then I can call this function, and delays cannot be added in a function.</p>
<p>So if I right click over here, I can just collapse this to a function.</p>
<p>And I can say that use health.</p>
<p>And this function we know that reduces health.</p>
<p>If I double click on this, it does the exact same thing over here.</p>
<p>Now, if you want you can convert this to a function to I'm going to leave it they've done that for now they've made functions for me, we've made a function for it yourself, but I'm going to leave the player death part as it is.</p>
<p>But I can maybe add this part to a function.</p>
<p>But that depends on you.</p>
<p>Or I can just collapse this to a node to collapse to node player deck.</p>
<p>So this basically just instill in an 11th graph.</p>
<p>It's not it's not a function or anything, but we're just making this part of the code faster.</p>
<p>I mean, shorter so that we can find out what's going on.</p>
<p>Okay, so now let's create a variable called battery's collected, there should be an integer by, what we're going to do is we're going to have a maximum number of batteries per level.</p>
<p>For example, this level will probably have eight different band aid batteries.</p>
<p>And once we've collected all batteries, we're going to check if the number of batteries we've collected is equal to the number of patties that are supposed to be collected.</p>
<p>And if it is equal, then we can say the player has won the game and move to the next level.</p>
<p>Or they can just display when screen but in this case We're going to just move to a new level, and you can add all the other functionalities.</p>
<p>So once we've reduced health, this part means the player has not died yet, as you can see over here.</p>
<p>So what we'll do is, after releasing the head, we're gonna check to see if the number of batteries we've collected is equal.</p>
<p>But actually, we're not going to do this in the player, we're going to do this in something called the Level Blueprint.</p>
<p>So if I go to my level effects here on blueprint, and if I hit on Open Level Blueprint, this is a different type of blueprint, it is for the level itself, and it can get access to every single object that's present in the level.</p>
<p>And I can add functionality based on that, for example I can get, I can get the character that's present in this level, and then check to see how many back he has collected.</p>
<p>And and check to see if the number of batteries I've collected is, you know, equal to the number of get batteries they're supposed to be collected, and then change to the next level.</p>
<p>So that started with that.</p>
<p>First off, in begin play, we're going to get hold of our BP underscore Batman.</p>
<p>So Get Player Character, we're gonna cost it to be fi underscore Batman.</p>
<p>So we're gonna, we're going to convert our character to the Batman.</p>
<p>And then as Batman, we're going to promote this to a variable, so that we have a reference to our player at all times.</p>
<p>And in tech.</p>
<p>So now we'll be introducing something else.</p>
<p>But before we we start making our Venn conditions, let's actually implement our batteries themselves.</p>
<p>So right click, create a new blueprint.</p>
<p>And this is going to be an actor, TV underscore battery.</p>
<p>If I open this up, I'm going to add something called box.</p>
<p>And I'm just going to add, actually, let me just add a cube over here.</p>
<p>If I scroll all the way to the bottom, okay, I'm adding a cube, this is going to be my battery, your title, try to try to change the Static Mesh to something else, maybe try to find a battery acid and change the mesh to a battery.</p>
<p>But I'm going to leave this as it is, we're going to scale it.</p>
<p>So if you want to scale and press our I'm going to make this flat.</p>
<p>Something like that.</p>
<p>Okay, awesome.</p>
<p>Now, what we'll have to do is, let me change the material to maybe I've seen this really cool material that Unreal Engine has, it has this very cyberpunk like texture, there we go.</p>
<p>I love this texture.</p>
<p>I'm going to make it this.</p>
<p>Okay.</p>
<p>Now, if we scroll all the way to the bottom, we have a lot of different events.</p>
<p>What these events are, is that when the component is hit, do something, when that when someone overlaps the component, do something when an object has ended overlapping, do something.</p>
<p>That's basically all these events are.</p>
<p>That's what these events do, let's try to take a look at the on component head event called when a component hits something solid.</p>
<p>So if this component hits, maybe something solid, like another cube or a player, what is it supposed to do, that's how projectile bullets work in game development to let's try to take a look at on competent head, press on if I click on the plus symbol, I have something called the head component.</p>
<p>And the other actor, the other actor is going to be whatever actor that has collided or hit this cube over here.</p>
<p>And we're going to cost this to our battery man.</p>
<p>No, not the battery, the battery man.</p>
<p>So search for battery man.</p>
<p>Now if this is true, so if I have cost, if I have hit the battery man, then we're going to get the health.</p>
<p>Get the battery.</p>
<p>And then we're going to add, maybe let's see, we're going to add an amount that actually let's make this a random value, subtract a node from this and then there should be there should be a node that says random float in range, we're going to we're going to add a value between five and 10.</p>
<p>So there's going to return a value of five and have a number, a random number between five and 10.</p>
<p>And from battery we're going to set battery again.</p>
<p>And then we can drag this in for Compile and Save.</p>
<p>Let's see if this works.</p>
<p>And I have to obviously destroy this object because I don't want to cheat so I can destroy the actor which means it's going to get deleted from the scene.</p>
<p>If I placed this object over here, and move this to the top, maybe we can add some lines This what? Oops, okay, I have to make sure I, the game isn't that difficult for me.</p>
<p>So I'm going to change my battery value back to 100, Compile and Save old faith, fam move towards this battery, you can see that my head has increased over here, let me show you again my battery.</p>
<p>So you can see it's slowly increased, which is what we're going to do over here.</p>
<p>Now, we're going to make sure we keep increasing our battery for our player over here.</p>
<p>Let me go back to my BP underscore battery, let me add a light over here, point light.</p>
<p>And make sure you raise it to the top because if it's inside the object, you won't be able to see it.</p>
<p>And we can make it red in color.</p>
<p>Okay, Compile and Save.</p>
<p>Now, here comes the interesting part.</p>
<p>This is where we make our wind conditions.</p>
<p>So over here, once we've added health added, okay, my opponent has been added battery to our battery man, we can add a variable to the batteries the player has collected.</p>
<p>So again, get the batteries collected over here.</p>
<p>And we obviously have the set of doses set that is collected, I hope this doesn't get too confusing.</p>
<p>If you do, then try to make try to do a little bit of math in a in a different project on your own by getting values from a player and casting them.</p>
<p>And you will be able to understand them in no time, I'm going to add one to the number of batteries collected.</p>
<p>So if I let's say I have three batteries already collected, I'm going to add one to it.</p>
<p>So that's going to become four, I'm going to set the batteries collected.</p>
<p>And then I'm going to destroy the cube, Compile and Save.</p>
<p>Now in my Level Blueprint, I have to make sure I define what is the maximum number of batteries, right.</p>
<p>So let's try to do that.</p>
<p>Now, right like, we're going to take a look at something called the Game Instance.</p>
<p>So let's take a look at Game Instance over here.</p>
<p>Now gi underscore battery, man instance citizen all of that.</p>
<p>So in this instance, what a Game Instance is that it is an object that persists persists through every single level.</p>
<p>So this object will be there in the main level.</p>
<p>And then level one, level two, level three, this this is going to persist in every single level.</p>
<p>So we can add a few variables that says okay, if it is level one, then make sure the number of batteries is let's say eight.</p>
<p>And that will do it has to be 10 etc.</p>
<p>Now, this is not the best way to do it.</p>
<p>But since this is a very beginner level tutorial, we're not going to go over gameplay, like proper gameplay mechanics.</p>
<p>So I'm just going to add a variable here.</p>
<p>So level one, then batteries, actually no Max batteries.</p>
<p>One.</p>
<p>So this indicates for level one, this is the maximum number of batteries are going to make it a float.</p>
<p>And let's this let's set this value to eight.</p>
<p>Now, if you want another level, let's say level two, you can say Max batteries, two, etc.</p>
<p>Now go to the Level Blueprint.</p>
<p>And you will have to do this for every single level.</p>
<p>But in tech, what we can do is we can right click Get Game Instance, we have to cast this to our battery man instance cost vi battery man instance.</p>
<p>And again, we can do this in big and play because we don't want to talk we don't want to cost this every single frame.</p>
<p>And then we can promote this to a variable gi battery math.</p>
<p>Okay, now from the battery man instance, what we can do is we can get max batteries for one.</p>
<p>And then from our battery man, the player itself, we can get get batteries connected.</p>
<p>We're going to check if these are equal.</p>
<p>Now I forgot to make this an integer.</p>
<p>So let's make sure this is an integer to Compile and Save level one that's checked to see if these are equal.</p>
<p>So I can if these are equal, then I can basically say so again, we have to create a branch so we're creating a condition over here.</p>
<p>So if we create a branch Event Tick, if these two are equal, then I've won the game.</p>
<p>So I can just end up opening the next level or again I can I can have a windscreen or whatever match has been opened another scene for this one.</p>
<p>And let's call this level, the next level, whatever.</p>
<p>For example, this one's going to be level two, you will have to do this for every single game level.</p>
<p>But remember in the C++ course, since that's going to be a more advanced course, we will take a look at how to make this a lot more scalable in the sense how to make sure we just add the logic once and we don't have to keep copy pasting our code on and on and on.</p>
<p>Now that they've created the Game Instance, we have to make sure we set it in our project settings.</p>
<p>So go to maps and modes.</p>
<p>And if you scroll all the way down, our default Game Instance has to be gi underscore battery instance, let us create another level over here.</p>
<p>So again, new level, there's going to be a default level and save it.</p>
<p>We're going to call this level two.</p>
<p>And that's pretty much it.</p>
<p>I bet we're done with all of our code mechanics.</p>
<p>Now, if I play the game, and let's say our maximum is going to be one.</p>
<p>So if I open up my Game Instance, over here, my maximum number of entries is going to be one, for example, save the game.</p>
<p>And if I play now, we now move to the next level.</p>
<p>So that's how we make our vent conditions.</p>
<p>Now all you have to do is decorate your level, maybe add a few obstacles, and maybe like a few cubes that distracts the player, maybe trying to make this into a maze, get a few assets from the marketplace and try to make it in such a way that maybe it's like in a spaceship, and the player has to find all the batteries from the spaceship, which would probably look really cool.</p>
<p>But now I have five different batteries here.</p>
<p>So I'm going to go to my Game Instance, maximum batteries is going to be five over here.</p>
<p>Compile and Save, and save it.</p>
<p>Okay.</p>
<p>Now let's see if this still works.</p>
<p>So all fie I'm going to collect, oops, it seems like I have to make sure this is all the way to the bottom.</p>
<p>So all the way to the bottom, all the way to the bottom.</p>
<p>Okay, all fee.</p>
<p>Now let's see.</p>
<p>So first, my battery does keep increasing.</p>
<p>So that's pretty cool.</p>
<p>But okay, I might, I might actually lose this.</p>
<p>I'm not really good at games.</p>
<p>Okay.</p>
<p>Okay, we seem to be we seem to win the game.</p>
<p>That's awesome.</p>
<p>And yeah, that's pretty much it for our vendor events.</p>
<p>Now, let's say your level two is your last event, what you do is in your level two Level Blueprint.</p>
<p>So if you open up the blueprint, just have the same condition that as you had in level one, except if it's equal, you create a new widget, your your windscreen, for example.</p>
<p>And then you display that windscreen on to the scene.</p>
<p>For example, if I go to level two, now, let me actually show you how to do it real quick.</p>
<p>So if I go to level two, open my Level Blueprint, now I can try to do this on your own, please don't try to copy what I'm doing.</p>
<p>That's fine, I want to show everything because I want to sort of make sure you guys get it on your own.</p>
<p>What you do is you will get your Game Instance again, you will cost this two battery instance.</p>
<p>And we're pretty much doing the same thing we did before.</p>
<p>And remember, if you have level two, your level two Level Blueprint open, you can open your level one level blueprint, it's going to get closed automatically.</p>
<p>So we're going to promote this to a variable.</p>
<p>And same thing.</p>
<p>The same thing happens except it's going to be for our Player Character.</p>
<p>So Get Player Character cost to battery man.</p>
<p>So basically converting it to battery man and then promote the variable.</p>
<p>And then we can get max, I mean get batteries collected.</p>
<p>And we can use this to compare.</p>
<p>So in our Event deck, what we'll do is we can get these to get batteries man so there's going to be so we have to create a new condition for level two.</p>
<p>So all you have to do is Ctrl C Ctrl V, rename this to max batteries to I'm just going to make sure the max battery is just something like one for my level two.</p>
<p>So this is equal to the number of batteries are collected, not battery number of patties collected batteries collected If this is true, what's going to happen is I can just print out, I can create a new widget, there's going to be my winning windscreen over here, which is going to basically have a text that says you win the game, and then it can have a quick game.</p>
<p>And then over here, we can say cost to, I mean, and to Viewport for time to compile, that it has an arrow here, because the Create Widget class has to be specified.</p>
<p>So let's create a new UI element over here.</p>
<p>So UI.</p>
<p>Actually, let me just let me let me do skaters W, BP underscore wind screen.</p>
<p>Now in stuff lose, they can just say, you when.</p>
<p>And we're going to load out for retry, we'll load the first level.</p>
<p>And actually, let's have the return to main menu part in this vein main menu, and quit game.</p>
<p>Yeah, fifth game is going to be the same.</p>
<p>Now in the graph, open level four, because we have to make sure we rename everything because we just duplicated it.</p>
<p>So for retry Game Over here, we have to make sure this says main menu now.</p>
<p>It's just for simplicity's sake.</p>
<p>Now when you press the main menu, we want to open up the main menu.</p>
<p>So we're going to create a new level called Main Menu, obviously, Compile and Save.</p>
<p>Because if I go to level two, I can just create the main screen and make sure you get the Player Controller.</p>
<p>So Get Player Controller.</p>
<p>Show Mouse Cursor, we're going to set it not get it.</p>
<p>So Show Mouse Cursor set it we are going to set this to true, Compile and Save.</p>
<p>Now we have the main menu we have the main menu part.</p>
<p>And that's pretty much it.</p>
<p>So my condition for my second level is going to be two sets need to collect two batteries and I've in the game.</p>
<p>So over here, we're going to end up adding batteries again, we'll add two batteries.</p>
<p>If I played the game now collected one collected two, and doesn't seem to be working, let's take a look at what's going on.</p>
<p>Okay, the reason why I wasn't working was because I got the variable for the first level.</p>
<p>So we're going to get batteries over here and make sure we set that now it's going to work.</p>
<p>So if I Compile and Save, and again, remember we have to make sure we detach from so okay, if I go back to my battery man, you see we have detached from pending destroy over here, we're going to do the same thing over here.</p>
<p>That's because as I move my mouse, I don't want my camera to move to in my windscreen.</p>
<p>So let's see, let's actually see if we can get this on our own.</p>
<p>So detach from nope, I'm not able to get that get that particular node.</p>
<p>So let's see if that's present in our Player Controller.</p>
<p>No, it's not present in our Player Controller, which means it should be present in our character itself.</p>
<p>detach from controller pending destroyed, there we go.</p>
<p>We can do that Compile and Save.</p>
<p>So this means we cannot control our player anymore.</p>
<p>So once I collect these two batteries, it says you went and again one more problem.</p>
<p>This is going on in tech.</p>
<p>So we have to make sure we do this only once.</p>
<p>We don't want this every frame it's going to crash your game which was about to crash my game.</p>
<p>So we have to make sure that only that's done only once.</p>
<p>If you want you can make put all of this in a function.</p>
<p>And yet we're gonna save this go back OLOFI collect the first one second one, we went quit game and we're done with the game.</p>
<p>Awesome.</p>
<p>Now, obviously this is not the best way to make a winning condition but if you want to do it, don't worry about making it the best way possible the first time you're trying it.</p>
<p>The main the main point is to understand how blueprints work first, and then in the next course that is fine.</p>
<p>The next course is going to be a more advanced course where we learn Proper winning conditions, all gameplay principles, etc.</p>
<p>Now, we have one more thing remaining.</p>
<p>And then we're finally done with this course, which is going to be our main menu.</p>
<p>So, in fact, I had to create another Widget Blueprint, W BP underscore main menu over here.</p>
<p>And I'm going to add an image again.</p>
<p>Let's make this fullscreen and anchored, make sure that's fullscreen.</p>
<p>And now, what we're going to do is, well, let me change this to black first, this is going to have two buttons, one is going to be play game one is going to be quit game.</p>
<p>That's pretty much it.</p>
<p>And I'm pretty sure this is self explanatory.</p>
<p>I'm pretty sure most of you guys will be able to do this on your own by now.</p>
<p>But if not, no problems, don't feel demotivated, it's completely fine.</p>
<p>It's normal.</p>
<p>So we're gonna save play game over here.</p>
<p>Duplicate this control, actually, yeah, Ctrl W, that's duplicate.</p>
<p>And they go, they're going to make this, I'm going to call this quit game.</p>
<p>And obviously, you can have another, you can have another button that shows the controls, etc.</p>
<p>Over here, that's add some text, text to both play game and do it again, I added it to the image by mistake.</p>
<p>So I'm going to remove that there's going to be called play game.</p>
<p>This is going to be called load game.</p>
<p>And obviously, we want to change the size to like maybe 34.</p>
<p>That's not gonna be faking.</p>
<p>I'm just gonna quickly over here.</p>
<p>And over here, again, go back to the font, make this 34 Compile and Save.</p>
<p>How do we tell the editor that whenever we open up a project or the game, we need to make sure it opens this main menu level.</p>
<p>To do that go to maps and modes.</p>
<p>And you can see your editor startup map and your game default map, what I'm going to do is I'm going to create a new level and make sure it opens up the main menu over there.</p>
<p>Now open up a new level.</p>
<p>Actually, we don't need to make it a default level, we can just create an empty level over here.</p>
<p>And Ctrl S, you can see that it's completely dark because there's nothing in this level, we're going to call this the Main Menu.</p>
<p>Over here, what we're going to do is open up your Level Blueprint.</p>
<p>Before that we had to add a game mode override because as I said, it doesn't have to add.</p>
<p>So if I run this game now, it's going to Okay, all up.</p>
<p>If you see it spawns up, it spawns the BP underscore Batchi.</p>
<p>Man, we don't want that, obviously.</p>
<p>So what we're going to do is we're going to add a game mode override over here, which means for this level alone, it's going to create a different game mode and it's going to use that so under Custom custom blueprints, I'm going to create GM underscore main menu.</p>
<p>And over here, under default point, it's going to be none under hard, I'm just going to have all of this normal.</p>
<p>Now.</p>
<p>Under blueprints Open Level Blueprint, again, we're going to do the same except this might be in vegan play.</p>
<p>So Create Widget.</p>
<p>And what we're going to create is the main menu and Add to Viewport Compile and Save.</p>
<p>Now if I go back to my project settings, scroll over scroll down here I have my editor start up map.</p>
<p>I'm going to keep my level selected over here so content levels main menu, I am going to hit this arrow and it's going to automatically assign my main menu now let's play the game.</p>
<p>So press Play Game nothing happens that is because we haven't added functionality yet.</p>
<p>So if I go to main menu, select this button again scroll all the way to the bottom on pressed you know what to do open level this is going to be level one.</p>
<p>And if if I go to quit game on pressed again, you can just quit the game.</p>
<p>Now make sure in level two level blue in our windscreen Level Blueprint.</p>
<p>It the level is named properly.</p>
<p>So that's main menu without a space, Compile and Save.</p>
<p>And this is to have a sense playthrough now.</p>
<p>So if I alt V three game, I have my HUD, and you may have VLC because of that, okay, there we go.</p>
<p>We're going to try to collect all of these on time.</p>
<p>And that's level two.</p>
<p>And level two, we're going to, we're going to get these two.</p>
<p>And now we win the game.</p>
<p>And we can quit the game.</p>
<p>That is pretty much it.</p>
<p>Now we have a tiny little part over here, the animation keeps playing for the animation keeps playing for our well in our level two after we win the game, because we haven't added a win condition in our Animation Blueprint.</p>
<p>So what we're going to do is we're also going to add another variable, and this variable is going to be called B has layer one.</p>
<p>Now in begin play, I'm going to make sure I set this value to false and make sure this is a bool.</p>
<p>So we're gonna change variable type.</p>
<p>Close Compile and Save, and make sure we set this to false every single time we start playing the game.</p>
<p>Over here, in my Level Blueprint, again, what I'm going to do is in level one, at Save Selected blueprints, Open Level Blueprint.</p>
<p>And we have to make sure we get this character from the from the character over here, set.</p>
<p>Clear one has player one over here.</p>
<p>If it's true, then we can set we can actually we have to set this only in level two, not our level one, because our player hasn't technically won the entire game completely yet.</p>
<p>So if I go to level two, open up my Level Blueprint, I have the same thing over here too.</p>
<p>Now if I, if I from the battery man, I have to set one just search for has player one, I'm going to double click on this node so that I can redirect this node over here like that.</p>
<p>Move it all the way to the end.</p>
<p>And then connect this, we're going to set this to true, I'm going to again add another node over here so we can detect it properly said looks a little neat.</p>
<p>Compile and Save.</p>
<p>Now let's open up our our Animation Blueprint.</p>
<p>And open that up.</p>
<p>Okay, over here now we're blending spaces wherever blending poses by bool over here.</p>
<p>Now, if player is dead, they're going to play the idle animation.</p>
<p>But if the player is dead, or if the player has won the game, we're still going to play the idle animation.</p>
<p>So over here, we're going to have an all Boolean, what this does is it checks if one of these will so takes into bool values.</p>
<p>And if it cannot be stick a lot more can take five, six, etc.</p>
<p>But we just need to have these.</p>
<p>So we're going to remove, then remove pan over here if the player is dead, or if the player has one, plate, the player dead animation.</p>
<p>So to get that cost to Batman, we've already done that.</p>
<p>From here, we will get one has clear one.</p>
<p>Move this all the way to the bottom.</p>
<p>And again, we're going to promote this to available the name is fine.</p>
<p>And all the way to the end.</p>
<p>There we go.</p>
<p>That looks a little neat.</p>
<p>AnimGraph place this over here.</p>
<p>So if any one of these conditions are true, we're going to play the idle animation.</p>
<p>So if I now play the second level one to see now my animations don't play continuously.</p>
<p>So I can now quit the game.</p>
<p>And that works perfectly fine.</p>
<p>Awesome.</p>
<p>Now that is pretty much it for this game.</p>
<p>Your challenge is to add your own map try to add your own level, go to the marketplace get there a lot of free assets that you can use.</p>
<p>Maybe make this into a spaceship and try this out.</p>
<p>The only problem now is that unfortunately since Unreal Engine five is still under development, most of the assets are not compatible with the engine.</p>
<p>So if I go back to my Epic Games launcher and if I try to add this free asset that I got from the free for the month thingie if I click on show all projects and try to select Unreal Engine five You can see it says asset is not compatible.</p>
<p>So what you'd have to do is you'd have to downgrade this project to Unreal Engine five.</p>
<p>And then you will have Unreal Engine four and then add the assets.</p>
<p>But the problem is you might have a lot of issues after upgrading it back to Unreal Engine five, which is why it is still in early access.</p>
<p>Not a lot of assets are still away are available for Unreal Engine five witches.</p>
<p>Yes, it is a little disappointing, but at the same time, they've specifically mentioned this engine is an early access.</p>
<p>So don't be too worried, you can follow the exact same tutorial that I've showed over here in Unreal Engine four, it's the same functionality, same blueprints, all of them work perfectly fine, it's just that the UI might look a little different.</p>
<p>This looks a lot more modern than Unreal Engine four.</p>
<p>That's the only difference accurate pretty much fine for now when it comes to at least the basic parts.</p>
<p>So this tutorial can be followed in Unreal Engine four, two, so don't worry about that.</p>
<p>But thank you so much for watching.</p>
<p>I really hope you learned something and I hope you were able to familiarize yourself with Unreal Engine five and game development.</p>
<p>If you've completed this course that is amazing tied to add your own functionality to it.</p>
<p>If you want to learn C++ stay tuned because I have a C++ course coming very, very soon we're going to create the exact same game but in C++ so that is going to be very, very fun.</p>
<p>But thank you so much for watching and I will see you very soon.</p>
<p>Bye and good luck. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Code an Endless Runner Game Using Unreal Engine and C++ ]]>
                </title>
                <description>
                    <![CDATA[ Endless runner games can be fun and addicting. Also, an endless runner game is a great game development project for a beginner. We just released a course on the freeCodeCamp.org YouTube channel that will teach you how to create an endless runner game... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/code-an-endless-runner-game-using-unreal-engine-and-c/</link>
                <guid isPermaLink="false">66b2014139b555ffda8bfe83</guid>
                
                    <category>
                        <![CDATA[ C++ ]]>
                    </category>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Thu, 21 Oct 2021 19:02:44 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/10/endless.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Endless runner games can be fun and addicting. Also, an endless runner game is a great game development project for a beginner.</p>
<p>We just released a course on the freeCodeCamp.org YouTube channel that will teach you how to create an endless runner game using Unreal Engine and C++.</p>
<p>Fahir from Awesome Tuts created this course. Farhir has created a bunch of great game development courses and has a knack for teaching beginners.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/giphy--3-.gif" alt="Image" width="600" height="400" loading="lazy">
<em>I hope she takes a break soon.</em></p>
<p>This course will teach you the basics of Unreal Engine and prepare you to create even more complicated games.</p>
<p>Here are the sections in this course:</p>
<ul>
<li>Game Preview</li>
<li>Creating The Player Class</li>
<li>Creating Obstacles</li>
<li>Creating The Level</li>
<li>Spawning Levels</li>
<li>Destroying The Player And Restarting The Level</li>
</ul>
<p>Watch the full course below or on <a target="_blank" href="https://youtu.be/SOjZTmOMGcY">the freeCodeCamp.org YouTube channel</a> (2-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/SOjZTmOMGcY" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-transcript">Transcript</h2>
<p>(autogenerated)</p>
<p>In this game dev course you will learn how to create an endless runner game using Unreal Engine and c++ file Fahir teaches this course.</p>
<p>He has created a ton of game development tutorials and he is an excellent teacher.</p>
<p>What is up guys Fahir here and back out again with another Unreal Engine tutorial this time a c++ one Yes, because a lot of your doozy blows blows.</p>
<p>Okay, I'm going to do a c++ tutorial.</p>
<p>Anyways, let us take a look at the game that we are going to create.</p>
<p>So over here I have my editor if I hit the play button, it's a simple side scroller game.</p>
<p>So if I, you know, jump and all that stuff, you see, we can jump we can move, the goal is to avoid this wall that is chasing us because if it touches us, we are going to die.</p>
<p>And of course, we are going to have obstacles along the ways such as these platforms, such as the spikes that we are hopefully going to see pretty soon, because they're not spawning all of this time.</p>
<p>There we go, we have the spikes.</p>
<p>If we touch the spikes, bam, we are dead, the level is going to restart.</p>
<p>If the wall hits us, bam, we are that the level is going to restart.</p>
<p>As you can see, it looks like a basic game.</p>
<p>But we are going to learn a lot of cool things, especially c++ wise, because we're going to do all of this in c++ from scratch coding everything and you're going to see me code and you know, you're going to enjoy that and learn a lot and yada yada yada.</p>
<p>Anyways, what else can I say? Let's jump into this.</p>
<p>Course.</p>
<p>Yeah, it's a mini course.</p>
<p>What else is there? No, it's a mini course.</p>
<p>Okay, it's tutorial mini course, whatever, let us jump into it and create the school game.</p>
<p>Alrighty, then my game devolves.</p>
<p>Now that we saw the game that we are going to create, let us create the game.</p>
<p>So over here, I have the Unreal Engine Project Browser, we are going to click here on games.</p>
<p>And by the way, this is unreal engine version four point 25.</p>
<p>And we are going to select our third person project.</p>
<p>So not the blank one, but the third person because we need some elements from that, you know, third person package.</p>
<p>And over here, we're going to click on Next.</p>
<p>And from blueprint, I'm going to click on the drop down list and select c++ because Yay, this is a c++ course.</p>
<p>And over here, I'm going to name my project I'm going to call it side rather CPP.</p>
<p>Of course, you can think of something more creative than that, I'm going to click here Create Project and wait until the project is created.</p>
<p>And then I'm going to come back.</p>
<p>And here we are finally.</p>
<p>So now what we are going to do is we are going to create the player and specifically the player class over here, by the way, I have this engine content, we will use that as well.</p>
<p>If you don't have it, you're going to click here where it says View Options.</p>
<p>So this right here that I draw, so click on that, and from there, you're going to click this checkbox show engine content.</p>
<p>So make sure that that is checked.</p>
<p>And then you will be able to see what I see in my project.</p>
<p>Also one neat trick, if you find that all of these elements inside of the editor are too small, especially if you have a big monitor, you can go over here on the under window and then developer tools.</p>
<p>And then you can go over here widget or reflector.</p>
<p>And let me just bring that bad boy over here.</p>
<p>And this is the scale for the application.</p>
<p>Usually I set it at 1.16 and it is going to rescale my application basically make it a little bit larger and that stuff so that I can see more better.</p>
<p>That's all there is to it.</p>
<p>Anyways, going over here in the content, I'm going to right click and create a new folder that I am going to call maps because over here we're going to create a new map and that is going to happen under File and the new level basically new level I said map but as the same thing Ctrl S to save it I'm going to save it over here and I am going to call this one game play and there you go.</p>
<p>So the first thing that I'm going to do with this gameplay is I'm going to remove the floor that we have over here so simply delete it and there you go.</p>
<p>And next I'm going to go here into geometry and meshes and I'm going to take this template for and please head over here and there you go.</p>
<p>Let me just position this bad boy so for the x is going to be zero for the Y is going to be zero z is going to be 20 and I am also going to rescale it so I'm going to click here on this lock icon to lock the scale and I'm going to say point 25 and there you go.</p>
<p>rescale it and Wallah.</p>
<p>Also in regard to the player start position let me just click on that yeah, it is going to be where it is.</p>
<p>And this is where we are going to spawn our player.</p>
<p>Now before we proceed to create the player class over here inside of the project settings and in the input we are going to have some mappings and axes.</p>
<p>So basically we only need the jumps I'm going to delete this reset we are simply click here on this x and delete it.</p>
<p>Here we are going to have move right we're not going to have move forward and all of these stuff.</p>
<p>So look up look rate, turn, turn rate and move forward.</p>
<p>We're going to delete all of these and leave only all of these.</p>
<p>Of course you can also filter these so we Don't need the GamePad, I basically only need the spacebar.</p>
<p>But again, that is up to you, depending on if you want to create, maybe you want to practice or whatnot, I don't know I'm not you I'm not, you know, I'm not controlling you and stuff like that.</p>
<p>So there you go.</p>
<p>So we should have jump and move right for the job, we have the spacebar for the move, right A and D, you can also add the, you can also add the left and right that is totally up to you, I am not going to go in there, you know, do not judge me.</p>
<p>So now we can go over here inside of our c++ or c++ classes.</p>
<p>And from there, there you go.</p>
<p>Here we have our side runner CPP character, I am not going to use that one I'm simply going to right click and go here New c++ class, it is going to inherit from the character I'm going to click on Next.</p>
<p>And I am going to call this one runner character and hit the Create class.</p>
<p>Of course, you know that it takes a while for Unreal Engine to you know, compile and load all of this, I am going to get an m two SSD just because of this, like I'm not getting just because of this, I'm getting an es m two excuse me SSD that can read for I believe, three 3500 megabytes per second.</p>
<p>So that is what I'm getting.</p>
<p>Okay, this is what I'm going to get.</p>
<p>And finally here is my class.</p>
<p>So we have the runner dot h file and the runner dot cpp file.</p>
<p>If you don't know the difference between the two I'm quickly going to explain so in the dot h file, we declare everything that we need and inside of our dot cpp file we then code all of that that we have declared simple.</p>
<p>Yes, it is.</p>
<p>So what do we need over here, right below where it says our generated body, I am going to declare a u property.</p>
<p>So it's prah per T, there you go.</p>
<p>Sometimes I cannot spell and I'm going to call it the visible anywhere, there you go.</p>
<p>And this one is going to be our class.</p>
<p>This is called a forward declaration when you type a class so that we don't have to include the file over here.</p>
<p>And I'm going to say you camera component, and it's a pointer.</p>
<p>So we need to denote that with the star.</p>
<p>And I'm going to call this one side view camera.</p>
<p>Now as I said, this is called a forward or forward declaration, I believe I'm not 100% sure, because I'm not good with those names, I don't care.</p>
<p>But essentially what is the point of this is that we declare it with a class over here so that we don't have to use the include over here, you see, because every single thing that we use, for example, if we want to use functions from the character, we need to include the game framework character.</p>
<p>But I don't want to do that for the camera component because every time you include the runner dot h file anywhere in your class or in any other class that is, then it will include all the includes that come with it, but when you use it like this, then it will not include them.</p>
<p>But inside of here runner.or runner character dot cpp then we are going to include it and that is the better way to go.</p>
<p>So over here, this is you know, the constructor for our character at the Begin Play and all of the good stuff tick and set up player input components, so we're not going to touch any of those.</p>
<p>Instead, what I'm going to do is over here protected.</p>
<p>And over here I'm going to declare my own functions and variables.</p>
<p>First things first, I am going to declare here void move right and this one is going to take a float value as a parameter.</p>
<p>And of course in a moment of do it is going to start complaining with a green line below this move right because we then declare it inside of the dot cpp file.</p>
<p>Don't worry about that we will do it in a few moments.</p>
<p>So over here, we're also going to create a public and this one is going to return our you camera component and again, it is a pointer and I'm going to call this one get side view.</p>
<p>So get side view camera component.</p>
<p>And this one is going to take a constant or actually it's a constant and it is going to return the side view cameras Simple as that.</p>
<p>Next we are going to have another public function that I'm going to call void re start level this is going to happen at the end when our player gets killed, which is something that we saw as well.</p>
<p>Also what I'm going to create and this is what I said is going to complain with this Don't worry we will implement this in a view.</p>
<p>Over here I'm going to create a u function.</p>
<p>And this one is going to be our void on over lap begin, it's going to take a u primitive.</p>
<p>So prayer may tiv component which is a pointer and I'm going to call this one over lapped component, comma.</p>
<p>It also takes an A actor Simply an actor, but it's spelled a actor.</p>
<p>It's a pointer and I'm going to call this one other actor.</p>
<p>There you go, we're also going to take another primitive component.</p>
<p>So I'm going to copy this here and paste it and it's a pointer.</p>
<p>So again, we need to use this star over here.</p>
<p>And other comp or other component, this I'm going to call it to takes an int 32.</p>
<p>Other body index, a Boolean B from sweep.</p>
<p>And last but not least, a constant of F hit result.</p>
<p>And over here sweep result, there you go.</p>
<p>And last but not least, a few more private variables, one is going to be the Z position.</p>
<p>So float z, the position, there you go, it's position like that, we are also going to take an F vector, which is going to be our temporary position that I'm going to denote is equal to f vector like that.</p>
<p>And last but not least a Boolean to denote if we can move or if we cannot move.</p>
<p>Now of course over here, as you can see, it is complaining for the move right and the restart level, it is not complaining for the on overlap again, but it will start complaining because I'm still waiting for that SSD to come.</p>
<p>So what we need to do is we need to declare this function over here inside of our runner character dot cpp file.</p>
<p>So we need to, as I said, declare it and that can happen by going over here and declaring and typing yet you know, void a runner character call on call on and so on, and so forth.</p>
<p>But there is a quicker way to do this, what we can do is we can click on this move right then I can right click, and then I can go here quick actions and refactoring.</p>
<p>And over here I can say create declaration definition.</p>
<p>And there you go.</p>
<p>When I click on that, it is going to create it of course, you know, this HDD drive, it's driving me nuts.</p>
<p>And I will probably have to cut out this video because you know, if I sing to you, that will cost you extra.</p>
<p>I mean, this is on YouTube, you don't pay anything for this.</p>
<p>But there you go, finally, okay, so now if I go here in the runner, there we go.</p>
<p>So we have the void runner move, right, we can do the same thing for this over here.</p>
<p>So we can, you know, do the same thing for the restart level by typing void a runner character call on call on will ride.</p>
<p>But instead of that, I'm simply going to right click again, quick actions and refactoring.</p>
<p>And I'm going to create a definition for it.</p>
<p>And last but not least, we need to do that for on overlap begin.</p>
<p>So quick actions refactoring create declaration, there you go, save this over here, save this over here, and voila, here are the functions that we need.</p>
<p>So from here There you go.</p>
<p>So what are we going to do when it comes to our runner character? Well for our runner character here is where I said that we are going to add those includes.</p>
<p>So first one I'm going to include, and that one's going to be components There you go, it's come ponents and then backslash and this one is going to be capsule component dot age, and I'm going to include everything that we are going to use so over here we're also going to include in quotes, game frame work, and then backslash spring actually we don't need the spring our component we need the camera so I got carried away usually when use the camera use the spring arm but I'm simply going to use the camera without it.</p>
<p>So camera dash or backslash camera component dot h There you go.</p>
<p>And also include and over here game frame work.</p>
<p>So game frame work, actually, yeah, it's Capital Framework like that.</p>
<p>And backslash character, movement component.</p>
<p>And there you go, actually thought Ah, and now there you go.</p>
<p>So this is the or these are the includes that I was talking about when I forward declared the camera component.</p>
<p>So instead of using this camera component include over here, I'm simply going to forward declare it like this.</p>
<p>And then over here I'm going to use the include because if we need to use the runner character in some other class and we need to include the runner character dot h file, when we include that, it will not include this import because this import is inside of the dot cpp file.</p>
<p>So over here inside of our runner character, which is the constructor basically, what we are going to do first we're going to set the capital component so I'm going to say get capsule component.</p>
<p>And from there, I'm going to say in it capsule size and the size is going to be 42 On the X and 96, on the Y, there you go.</p>
<p>I'm also going to set the channel to response to collision with overlap, basically setting the collision settings to response with overlap.</p>
<p>So over here, I'm going to say get capsule components or get the capsule, capsule component, there you go.</p>
<p>And over here, I'm going to say set collision response to channel.</p>
<p>And from here, going down, I'm going to say ECC underscore game trays channel, and is going to be traced channel one.</p>
<p>And I'm going to say a CR, over lap, there you go.</p>
<p>And moving forward, we are going to the note that we are not going to allow the controller to rotate us, instead we are going to use our own or basically we're going to control this class from within itself.</p>
<p>So I'm going to say here be use control rotation pitch, that is going to be equal to false.</p>
<p>I'm also going to simply copy this and paste it, paste, paste it and this one is going to be pitched then we're going to have the role.</p>
<p>And last but not least, we're going to have the yard basically, as I said, this is not going to allow the controller to rotate, the controller is not going to rotate this character instead, we are going to do that from within this class.</p>
<p>And since this is a side scroller, we're not going to rotate at all.</p>
<p>Next, I'm going to create the camera so our side view camera is going to be equal to create default sub object and it's going to be type of view camera component like that.</p>
<p>And I'm going to give it a name by passing here a text.</p>
<p>And that name is going to be side view camera Simple as that There you go.</p>
<p>Nothing complicated, I'm also going to or I don't want the controller to rotate the camera as well.</p>
<p>So I'm going to say side view camera.</p>
<p>And over here, I'm going to say be use pan control rotation that is going to be false.</p>
<p>So this is not going to allow the controller to rotate the camera.</p>
<p>Next, I'm going to set the character movement to face the direction that we are moving to so we are moving to the or in this case, because the game is a side scroller, we can move forward or we can move backwards.</p>
<p>So that is why I'm going to say over here, get character movement.</p>
<p>And from there, I'm going to say be orient rotation.</p>
<p>So orient rotation to movement that is going to be equal to true, which is basically going to allow us as I said, to rotate towards the direction where we are going.</p>
<p>Now this is going to be the rotation rates, I'm going to say get character movement, but I'm going to copy it because we're going to use it the few times over here.</p>
<p>And I'm going to see here a rotation rate.</p>
<p>And that's going to be equal to App rotate or, and over here I'm going to say zero for the X 720 for the y and 0.0 F for the Z now if somebody is confused if this is your first time seeing Unreal Engine c++ code, first things first, I'm advising you to go through my c++ tutorial series here on YouTube.</p>
<p>You'll have that in my Academy as well.</p>
<p>But what I wanted to say is if you're confused why I'm using here is 0.0.</p>
<p>But over here 720 point and I don't add zero what is the difference? Well, there is you there isn't actually so you can add zero you can emit zero is the same exact thing.</p>
<p>So that is when it comes to the rotation rate that I'm going to actually point zero here and move this backwards, and there you go.</p>
<p>So next we're going to set the gravity scale for our characters.</p>
<p>So I'm going to say gravity scale that is going to be equal to two.</p>
<p>I'm also going to set the air control so air control is going to be equal to zero point f air control is basically how or the how much control of our character do we have while he's in the air the higher the number, the higher the control.</p>
<p>Next we're also going to say here, our jump z velocity is going to be equal to 1000.</p>
<p>That's basically going to be you know how far or how high we can jump.</p>
<p>Next over here I'm going to say ground reaction is going to be equal to three.</p>
<p>And ground friction is basically you know the collision with the player and the ground.</p>
<p>Also over here I'm going to set the max walk speed that is going to be equal to 600.</p>
<p>And last but not least max fly speed that is going to be equal to also 600.</p>
<p>And there you go.</p>
<p>And now we are going to get our temporary positions and we'd say temp pose that is going to be equal to get actor location, which is the current location of our actor or Basically the game character and I need this temporary position because I'm going to say our z position variable is going to be equal to temp, position that z plus 300.0.</p>
<p>There you go.</p>
<p>And now what do we are, what do we need to do, we need to bind, we need to bind our controls if we want to move the character.</p>
<p>So over here, we have our set up player input.</p>
<p>And this is where we are going to bind the axes and the jumping and all of the good stuff.</p>
<p>So now we have this player input component that is passed over here in the setup input component.</p>
<p>So I can simply use that.</p>
<p>And I can say, player input component, which is, you know, called as you can see, to bind functionality to input.</p>
<p>So I'm going to say over here, bind action.</p>
<p>So bind action, and I'm going to bind the jump action and how where or what, where do I have this jump action? Well, the jump actions over here, if I go into the project, here it is action mappings.</p>
<p>And this is the jump action.</p>
<p>So this name needs to match up with the name over here that we specify.</p>
<p>So bind that to.</p>
<p>And of course, because this is an action, we can press it and release it.</p>
<p>So I'm going to say IE pressed basically, what do we want to do when we press the jump button? Well, over here, we're going to bind it passing this as well.</p>
<p>And over here a character call on call on jump, there we go.</p>
<p>So essentially, when we press the jump button, or in our case, the jump button is denoted with the spacebar.</p>
<p>So when we press the spacebar, we are going to call the jump functionality from the character that we have inherited.</p>
<p>Because this class inherits from the character see here public a character.</p>
<p>And the character has some built in functionality such as jumping.</p>
<p>So I'm also going to copy this because when we release it, we are going to so this is I II pressed and over here, ie released.</p>
<p>So when we release the jump button, instead of jumping, we're going to stop jumping, this will stop the jumping of the player and he will start to fall down Simple as that.</p>
<p>Next I'm going to take the player input component, and now I'm going to bind the axes instead of binding the action and I'm going to bind the move right.</p>
<p>And I'm going to bind it to this referring to this class and referring to the a runner character call on call on move right? There we go.</p>
<p>So this right here is going to bind to the move right, which is again, going back over here, this is that move right, it is going to bind to our move write function, which is this function over here.</p>
<p>So essentially Now, over here in our move right, we are going to add the code that is going to move the player.</p>
<p>So over here, we're going to test if can move and we are going to use this to the note if the player can move when he's dead, we will see that later on.</p>
<p>But if the player can move we're going to say add movement input.</p>
<p>And from here I'm going to say f vector.</p>
<p>So it's f vector, and over here, zero movement on the X on the Y is going to be one and on the Y or actually on the Z, it's also going to be zero in over here, I'm going to pass the value that we have.</p>
<p>Now in order for this to work we do need to denote inside of our Begin Play that can move.</p>
<p>So can move is going to be equal to true.</p>
<p>This is when we start our game, which is you know normal and all of the good stuff, otherwise it will not work.</p>
<p>So I'm going to hold Ctrl Shift and press B This is going to compile my code.</p>
<p>And of course, we're going to wait a few moments.</p>
<p>I don't know maybe I will cut out this video depending on how much it will take.</p>
<p>Because again, my SSD is the lot here, I can also try to sync to you none and then and then and then there you go.</p>
<p>It worked.</p>
<p>You see here build succeeded, which means now we can go inside of our editor.</p>
<p>And if I were to go into the gameplay and hit the play button, we do see a character and we can move the character but this is not the her character.</p>
<p>This is the built in one that we have that we have created with the project.</p>
<p>So in order to create our own character, I'm going to right click over here and go into the new folder.</p>
<p>I'm going to call do some blueprints.</p>
<p>And from here I'm going to click and go inside of that folder and I'm going to create a blueprint class and I'm going to inherit from the runner character.</p>
<p>So here is my runner character and I'm going to click on that one and I'm going to say BB runner character.</p>
<p>So this is now our character.</p>
<p>This is going to create our character from the class that we have just created.</p>
<p>Of course, as you can see, we don't have anything.</p>
<p>We do have the side view camera you see we have created it over here, but what we need to do is we need to click on the mesh and over here, we need To add the Skeletal Mesh, which is basically going to be our mannequin, which is this bad boy over here, I'm also going to set his z location to negative 97 to lower him a little bit down as you can see, and I'm going to rotate him 90 or minus 90 degrees like that.</p>
<p>And basically that would be it.</p>
<p>I can compile save this well one more thing we do need to attach here, a blueprint class for his animation, which again, click on the drop down list and we have the third person an MVP, which automatically will make him or he will be animated.</p>
<p>Now in order for us to add our character right now in the game, we need to create our own game mode because if you remember from the previous tutorial, previous Unreal Engine tutorial series, over here, inside of the maps and modes, you see we need to create our own game mode.</p>
<p>Because currently, again, if I hit the play button, this is not our character.</p>
<p>See, this is not the character that we want.</p>
<p>Instead, over here, I'm going to right click and blueprint class, and I'm going to filter from game mode or filter for game mode and click here and inherit from game mode is going to be our BP runner or side runners cuse me side runner underscore game mode.</p>
<p>And let's go over here into the into the Project Settings and select the BP side runner game mode.</p>
<p>And here instead of the default pawn, I'm going to select the BP runner care Rector.</p>
<p>And finally, this is going to allow us to have our own character in the game.</p>
<p>So if I hit the play button, there we go, if I inject, here he is.</p>
<p>Now we if I possess him, we have a problem.</p>
<p>You see, we don't see the character, we don't see anything.</p>
<p>And the reason for that is we can move him if I don't know if you notice, pay attention to where he is currently if I possess him, and if I move like this, I'm moving.</p>
<p>And let's try to see where he is now.</p>
<p>You see, he almost fell down.</p>
<p>So there we go.</p>
<p>Okay, so what do we need to do in order for this to make this work? Well, we need to go back in our c++ class, and over here where it says the tick.</p>
<p>So inside of Arctic functionality, we need to say our temp position.</p>
<p>So temp p o S is going to be equal to get actor location, again, we're getting the actor location, our temp position that x is going to be equal to or we're going to subtract from it 850 like this, and on the Z position, so temp position that z is going to be equal to z position.</p>
<p>So z position.</p>
<p>And last but not least, our side view camera set world location over here, we're going to pass the temp position, and there you go.</p>
<p>So what this is going to do, it's again going to get the current actor location, the current actor location is basically Well, the actor location, just getting but the current location is the location of our own actor of the character, we are going to then change the exposition, So subtract from it 850, and the Z position is going to stay the one that we have over here, and then we're going to set that position to the word location of the camera.</p>
<p>So Ctrl Shift B in order for us to compile this.</p>
<p>And by the way, I'm not going to do that, but you're going to do it if you want to see the outcome like if you change this number to minus 1000 minus 100 said the Z position over here, I don't know plus 500.</p>
<p>Try it out see the outcome that will be you know, that will be our practice you will understand more so if I hit the play button now There we go.</p>
<p>You see here is our character he falls down Look at that, we but if he falls down like that, we cannot see him anymore.</p>
<p>So that's all there is to it.</p>
<p>Anyways, again, hit the play button, we can possess the character, look at that, we can move over here, we can move over here.</p>
<p>That's the point you see, and he is rotating towards the direction where we are moving.</p>
<p>If we move backwards, you see he rotates to move backwards.</p>
<p>If we move forward, he rotates to move forward.</p>
<p>There you go, we can press base to jump like that.</p>
<p>There you go.</p>
<p>But the issue is we only have this one platform.</p>
<p>How are what we need to do well, we need to create more platforms, it's logic.</p>
<p>So starting from the next video, we are going to prepare everything to start creating our level parts and then we are of course going to start encoding all of that so that we can have our level to play the game.</p>
<p>If something was not clear in regards to this video, make sure that you ask in the comment down below and I will help you out and I will see you guys in the next video.</p>
<p>Alrighty then my game dev ELS before we can create our level we also need to create the obstacles because they are going to be part of the level.</p>
<p>So over here in our c++ class, I am going to create a new c++ class and it is going to inherit from the actor.</p>
<p>So one is going to be called obstacle.</p>
<p>So over here, I'm going to see up the call.</p>
<p>And of course wait for Unreal Engine to add it into the project again, that SSD is going to arrive on Mondays or Thursday, Tuesday, because now it's Saturday for me recording this.</p>
<p>I'm going to sing to you in the meantime then and then and then and then and then and then and then and then and then and then and then and then thank you very much that will be $5 extra.</p>
<p>Now the bad news is that we need to create another one.</p>
<p>So I right click over here, New c++ class, and this time an actor again and this one is going to be spikes.</p>
<p>So spikes There you go, hit enter, of course and wait for it to torture us.</p>
<p>What else can I say? The good thing is that we are not going to code anything.</p>
<p>Instead, we're just going to use these classes so that we can, you know, do a cast later on when we collide with these objects, of course, from the blueprints that we will create.</p>
<p>So over here, if I open it, let me just reload everything, reload again.</p>
<p>There you go.</p>
<p>So we have the spikes, we have the obstacle.</p>
<p>But as I said, we are not going to code anything over here.</p>
<p>Instead, we're just going to use these as references to create blueprints.</p>
<p>So let's go back in our Unreal Engine, and over here into the blueprints, I'm going to right click a new folder, and I'm going to call this one obstacles.</p>
<p>And inside of the obstacles, I'm going to create a blueprint class one is going to inherit from the obstacle, which is this bad boy.</p>
<p>And I'm going to call it BB obstacle.</p>
<p>Simple, very simple, right click again, blueprint class.</p>
<p>And over here, one is going to inherit from the spikes.</p>
<p>And I'm going to call it BP underscore spikes.</p>
<p>Simple.</p>
<p>Double click it, open it in our editor over here almost said Visual Studio, but it's actually the editor again.</p>
<p>So what are we going to do? Well, first things first, for the spikes, I am going to click on this BP spikes and add a static mesh component that I'm simply going to call spike very simple.</p>
<p>Now for the spike Static Mesh over here, I'm going to click on the drop down list and filter for our quad pyramids.</p>
<p>I'm going to say quad pyramids, there you go, this is the one that we want.</p>
<p>And over here for the materials, I am going to filter for the clay new, and this is the one that we want.</p>
<p>There you go.</p>
<p>This is pretty much it except over here, I'm going to set it to minus 50 on the Z position, so simple as that.</p>
<p>And also when it comes to the collision, we are going to do one interesting thing.</p>
<p>First things first, I'm going to compile and save this and I'm going to go here into the project settings.</p>
<p>And I'm going to go here into the collision for the project settings.</p>
<p>So it's basically this over here under engine when you go into the project settings.</p>
<p>Over here, we can create our own object channels.</p>
<p>What does that mean? That basically means we can create our own layers to differentiate the collision between actors.</p>
<p>So over here, I'm going to click on new object channel, and the name for that one is going to be obstacle and the obstacle is going to block.</p>
<p>So the obstacle is simply going to block the player, it's basically going to be a solid body not allowing the player to pass through.</p>
<p>And that is what a block is.</p>
<p>And I'm going to click here except next over here, I'm going to say new object channel and this one is going to be our spike, but the spike is going to overlap, the spike is going to overlap so that we can overlap in the deck collision between the spike and the player.</p>
<p>I'm going to click here except so now we have the block and the overlap channels over here.</p>
<p>What does that mean that means now that I can go inside of the spikes over here and scroll down over here where it says the collision There you go, this bad boy over here, I can zoom in for you to see There you go.</p>
<p>So over here the collision preset.</p>
<p>I'm going to set that to custom so click on the drop down list and click here of custom from the list.</p>
<p>Over here we are going to have the collision back to query only.</p>
<p>So we are going to have query only no physics collision because we don't want the physics we don't want to collide as a physics object with our pyramid or basically the spike and over here for the object type.</p>
<p>Now we are going to have so let me just Compile and Save this.</p>
<p>So now we should see the spike and the obstacle which is the one that we have just created over here.</p>
<p>If you don't see it right away, just Compile and Save for your blueprint.</p>
<p>And then here from the object type where it says world dynamic you can select this one to be spike, and there you go.</p>
<p>So over here I'm going to set our spike to overlap everything except over here the obstacle I don't want it to overlap the obstacle and we can also set here not to overlap or simply ignore the camera because we don't need the camera Compile and Save that.</p>
<p>So it is going to overlap all of these other ones.</p>
<p>responses such as the pawn physics body, which basically our player were going to set him to be upon.</p>
<p>So this right here will be able to overlap with the player.</p>
<p>And of course then we will detect collision between them and destroy the player and all of that good stuff.</p>
<p>So now we can move forward to our cube or to the obstacle which is this one and again, from here static component we are going to filter for our static mesh, and I'm going to call this one cube or simply call it block obstacle There you go.</p>
<p>Over here for the static mesh, I am going to filter for the cube.</p>
<p>So simply type cube and there you go, where is the QB QB.</p>
<p>There you go, here is the QB QB.</p>
<p>And over here for the material, I'm going to say basic shape material.</p>
<p>This is what I want Compile and Save that.</p>
<p>Now I'm going to leave at 000 for X, Y and Z and I'm not going to touch it rotation I mean there is no point in touching the rotation because it will still be the same it's a cube.</p>
<p>And going back over here again for the collision preset instead of block all dynamic we are going to set it to custom over here the collision enabled will be query and physics because again, this obstacle this block obstacle, it is going to be a solid body and it is going to block the player when the player collides with it, the player will not be able to pass through it.</p>
<p>And over here for the object type we're going to set that to be an obstacle and we are going to set it to block everything except over here to spike we don't need it to block the spike you can simply overlap this spike, but it is going to block everything meaning it's a solid body, I'm simply going to compile and save that and there you go.</p>
<p>So this is pretty much it as a preparation when it comes to creating our level parts.</p>
<p>Now of course if something was not clear, make sure that you ask in the comment down below and starting from the next video we are going to build our level pirates and the level and all of the good stuff then we're going to start spawning them and yada yada yada.</p>
<p>So I will see you guys in the next video would it is game day begins here EDA has moving forward now we are going to create our levels and for that we are going to go inside of our c++ classes and right click and build a base level class which is going to inherit from the actor and I'm going to call this one so over here, base level and hit enter to create the class and of course, we will have to wait a moment or two or a gazillion moments for Unreal Engine to take mercy upon our motors mortal souls.</p>
<p>Until we forget SSD man the more you watch these videos, the more ad revenue i get i guess and the more faster I can buy that SSD.</p>
<p>Just kidding, but let's go over here and reload everything there you go.</p>
<p>Here we have our base level dot age and here we have our base level dot cpp so inside of our dot h The first thing here at the top right below the includes over here I'm going to forward the Claire so I'm going to say class you box bone and as I said this is called forward the coloration so that we don't have to use the import or include Excuse me.</p>
<p>Now going back here at the bottom right below the public virtual void I'm going to create protected and I am going to create a new property.</p>
<p>And this your property is going to be blueprint read and write it is also going to be editable anywhere.</p>
<p>So edit anywhere.</p>
<p>And last but not least I'm going to set it under a category which is going to be equal to triggers like that.</p>
<p>What the hell is this teacher I don't know I'm confused the I want to slap you listen, listen, and don't slap me.</p>
<p>Okay, so what we have over here is blueprint read and write, basically meaning the component that we now declare which is going to be a you box component, which is a pointer, so I need to add a star over here.</p>
<p>And I need to call this or I don't need but I'm going to call it a trigger, which means that this component trigger can be read and written, we can edit it and we can get a value of it inside of the blueprint edit anywhere means we can edit it inside of the Blueprint Editor on the side in the details tab.</p>
<p>And the category triggers basically when we search for this component in the blueprint code, we will find it under the triggers category.</p>
<p>So we can also call it my triggers you can call it like that and we will see that when we search for it.</p>
<p>So what I'm going to do is copy this and paste it down below because we are going to have the same signature, but this time we're not going to call this one trigger but I'm going to call it spawn location like that.</p>
<p>And last but not least, we're going to have to public function so public like that.</p>
<p>And what's gonna happen here these functions are going to return a u box component which is a pointer so this one is going to be get trigger which is going to get our trigger not Teague.</p>
<p>It's a trigger, and another one for you box component.</p>
<p>And it is a pointer.</p>
<p>So over here, I'm going to say get spawn location like that.</p>
<p>And there we go.</p>
<p>Now don't worry if this is still white text, you know takes unreal lunger engine for this to compile.</p>
<p>While we're waiting for that SSD, you get my point I'm going to right click on this bad boy quick actions and refactoring, I'm going to create a declaration for it over here, do the same thing, quick actions, refactoring, create a declaration for it.</p>
<p>And of course, I don't know what to say I mean, you see, you see the issues we all have.</p>
<p>So inside of our CPP is where we are going to include same as what we do with our players.</p>
<p>So include, and I'm going to include components, backslash box component dot h, it's that age, there you go.</p>
<p>And inside of our Begin Play, I am first going to test if the trigger, if it's not equal to null PTR, meaning null pointer, then I'm going to say trigger.</p>
<p>And from here, I'm going to say be hidden in game is going to be equal to true and not allow that trigger to be you know, visible in the game live, just compile all of this, so that we make sure that nothing is wrong, and that everything should be working because it's not giving me out to complete the argument, the anything you see build succeeded, we're good to go.</p>
<p>But you know, it takes Unreal Engine, I will probably have to restart or close my Visual Studio and open it for this to work.</p>
<p>I don't know, do not ask me over here right now going to return a null pointer, instead, I'm going to return a trigger.</p>
<p>And over here, I'm not going to return an old pointer, instead, I'm going to return a spawn location.</p>
<p>That's all there is to it.</p>
<p>And again, make sure that you compile or build this.</p>
<p>So it's Ctrl, Shift B to build this code.</p>
<p>And voila, there you go.</p>
<p>Of course, another way to build this code is to go here and simply Click Compile does the same exact thing.</p>
<p>But I am not going to do that.</p>
<p>Otherwise, we will wait a lot.</p>
<p>So let's go over here inside of our blueprints, and right click and create a new folder, and this one is going to be our levels inside of the levels folder, I'm going to right click and create a blueprint class and inherit from the base level, there you go and select I'm going to call this on BP level one, of course, we're going to have level two up to level 10.</p>
<p>And what's going to happen in this one, I'm going to open it and I'm going to create a few levels.</p>
<p>And then I'm going to leave up to you to create the other levels because you know, this process can be a little bit tedious, it takes a little bit of time and all of the good stuff, the first thing that I'm going to do over here, in side of the inside of the VP level, I'm going to go and add a few components, the first few are going to be a static mesh, one is going to be a floor.</p>
<p>And another one, I'm going to duplicate this bad boy, so copy and paste then instead of floor, I'm going to call this one cube, there you go.</p>
<p>And also I'm going to have to box trigger.</p>
<p>So box collision, that is one I am going to call and this is not going to be a child of the cube.</p>
<p>So I'm going to call this one trigger box, copy and paste it and this one, I am going to call it spawn location box.</p>
<p>Let me just Compile and Save that.</p>
<p>And let me just add everything that I need.</p>
<p>And we are going to code or actually before that in the Event Graph.</p>
<p>What I'm going to do is remove all of this.</p>
<p>And over here we have in the Event Begin Play, I'm going to set the spawn location.</p>
<p>So I'm going to right click over here and I'm going to say set spawn location.</p>
<p>And notice it's under my triggers.</p>
<p>Look at that, you see this over here.</p>
<p>Look at my triggers.</p>
<p>It's basically what we did in our code.</p>
<p>So if I go back over here, where we have declared these triggers, look at that.</p>
<p>So my triggers, this is that category.</p>
<p>So now we can find them under this category inside of our blueprints when we want to code.</p>
<p>So I'm going to right click and I'm going to say set spawn location and the spawn location again, make sure that it is under my trigger.</p>
<p>So set spawn location, here it is under my triggers, and execution flow is going to go over here and I'm going to set that or the spawn location box is going to be the spawn location.</p>
<p>Next from there, I'm going to say set trigger, and it's this one over here under my triggers.</p>
<p>So the execution flow is going to continue over here and then I'm going to take the trigger box and plug it in over here and let me just Compile and Save that.</p>
<p>What this is going to do is going to set the spawn location from our code to this one over here.</p>
<p>So we have have, you know connected these two, meaning that now this is a reference to this over here, same thing that we did over here, make sure that you Compile and Save that.</p>
<p>So now going inside of our viewport, and here is my floor, what am I going to do to the floor? Well, I'm not going to do anything to the floor, because you know, I'm a good boy, I'm not going to do anything.</p>
<p>Instead, what I'm going to do is go over here for the static mesh and filter for the cube.</p>
<p>And there you go, here is our cube for the material, we are going to say basic shape material, voila, that's all there is to it.</p>
<p>And I am going to change the scale of it.</p>
<p>So the scale x is going to be 10.</p>
<p>The scale y is going to be one and R, let me just go over here, I have locked the icon.</p>
<p>So I don't want to lock anything.</p>
<p>But over here, scale, x is going to be 10, y is one and 0.5.</p>
<p>So this is going to be this is going to be our floor.</p>
<p>Next we're going to have a cube.</p>
<p>So over here, taking the cube.</p>
<p>And again, adding a cube to it.</p>
<p>And over here basic shape, basic shape material, there you go.</p>
<p>Now for this cube, I'm going to set it and 90 for the Z position and leave it like that, that's all there is to it, the trigger box, I'm going to take it and for the trigger box, I'm going to set that location 380 The location was going to be stay or stay at zero and the location z 250.</p>
<p>And I am also going to set the Z scale to 10.</p>
<p>Over here for the trigger box, the trigger box is basically going to be the trigger that when we pass through it then we are going to detect collision and then we are going to spawn a new level.</p>
<p>So this is what we are going to do with the trigger box.</p>
<p>So when the player passes here and he touches that collision, then we are going to then we are going to detect that and we are going to spawn new level and over here just make sure that it is overlap all dynamic.</p>
<p>So the collision preset is set to that.</p>
<p>Next we have the spawn location and the spawn location.</p>
<p>What am I going to do with it is simply I am going to reposition it.</p>
<p>So I'm going to position it at 1,000th.</p>
<p>And that's all there is to it.</p>
<p>So the spawn location, we are going to use its position to position the next level.</p>
<p>So when we spawn a new level, it is going to start positioning from here.</p>
<p>And basically it's going to form a new level like that.</p>
<p>Simple, that's all what we are going to do with the spawn or with the spawn location.</p>
<p>So this is our level one and just make sure that you Compile and Save that.</p>
<p>If I go over here inside of the gameplay, I'm going to right click and create a new blueprint class.</p>
<p>And now you're going to assume that again, I'm going to use the base level but this time No, instead I'm going to use level one.</p>
<p>And every next level that I create is going to be a child of level one.</p>
<p>So BP level one, I'm going to select that, and this one's going to be BP level two, there you go.</p>
<p>And I'm simply going to open it, it already has all of these components set up in the Event Graph, it is going to call the parents Begin Play which is going to do all of this, it's going to prepare everything, we don't have to do it again for this blueprint.</p>
<p>Very clever I know.</p>
<p>And that's all there is to it.</p>
<p>Of course now we're simply going to add new things to it.</p>
<p>And that would be it, for example, the cube that we have over here, I'm going to reposition and so the exposition is going to be minus 330, the Y is going to stay the same and the Z is going to stay the same.</p>
<p>But I'm also going to add new boxes.</p>
<p>So I'm going to copy this cube and paste it and I'm going to call this one cube two.</p>
<p>And for this cube two, I am going to reposition it.</p>
<p>So x is going to be 190 y zero z 130.</p>
<p>And I am going to set the Z scale at three for the Z scale.</p>
<p>Simple as that and copy this one copy and paste now we have the cube three, and for the cube three, the position x is minus 70, the position y 01 180 for the Z and set the Z scale 2.3 and Wallah, Compile and Save that.</p>
<p>So this is our level two blueprint.</p>
<p>Simple, very, very simple going back over here, right clicking, and again blueprint class.</p>
<p>Again, inheriting from level one, there we go.</p>
<p>Not level two, but level one, and this one is going to be BP level three.</p>
<p>Again, we have everything prepared we we have our base queue, we have everything here prepared in the Event Graph.</p>
<p>We don't have to do anything, but we are going to change or reposition this cube.</p>
<p>So again, minus 330 For the x, y, I'm not going to touch in z, I'm not going to touch so it's going to stay as is.</p>
<p>But now I'm going to copy this cube and rename it to cube two.</p>
<p>And this cube two is going to be repositioned at 70 for the x, y 04 20 on the z axis, and over here, I'm going to say three scale for the Z Compile and Save that.</p>
<p>Moving forward, we are going to have another level.</p>
<p>So blueprint class over here, inherit from the level.</p>
<p>So inherit from our level one, select BB, level four, double click it and open it over here in Visual Studio.</p>
<p>And again, simply repositioning things so cube over here is going to be repositioned x is minus 303 30, excuse me, 174 the z axis, then I'm going to copy this cube and rename it to cube two.</p>
<p>For our cube do, I am going to set the position 160 on the x y zero 2020, or two to zero for the Z and resize the Z scale to four.</p>
<p>Last but not least, we have another cube, so copy and paste, and this one is going to be at the 10 for the X 370 on the Z and the scale, Z is going to stay one, but the scale x is going to be two and Compile and Save that this is our level for moving forward, I'm going to right click, and again inherit from level one.</p>
<p>There you go.</p>
<p>And this one's going to be our BP level five.</p>
<p>And now we're going to add some spikes in here.</p>
<p>And this is the last level that I'm going to create the next levels are on you.</p>
<p>So over here for the cube, I'm going to set the x at minus 30 and the Z 390.</p>
<p>And I am going to set the x scale to three the Z scale 2.3 There you go.</p>
<p>And last but not least, we are going to attach something or we are going to attach a spike.</p>
<p>And I am going to do the following.</p>
<p>So here I'm going to click on Add Component selecting the BP level and I'm going to filter for child actor.</p>
<p>And this one is going to be our spike.</p>
<p>There you go.</p>
<p>I'm going to call this a spike too.</p>
<p>But of course we're going to have spike one as well.</p>
<p>So copy this one.</p>
<p>And so what we are going to do for our spike to is over here you see the child actor component.</p>
<p>From here, we can select the blueprint, we can click here, and I can filter for spikes.</p>
<p>There you go.</p>
<p>And let me just remove this one I'm going to duplicate this one after.</p>
<p>So for this one, I'm going to set the X to two to zero and the Z is 40 There you go.</p>
<p>But I am going to move it a little bit upwards so something like this.</p>
<p>There you go here on this position grid snap Val and we decided to one so I can snap it a little bit better, while odd There you go.</p>
<p>And I'm simply going to copy this and paste it and this one's going to be our spike one and simply move it over here.</p>
<p>Basically the position x is minus 260 and there you go Compile and Save that so this is the last level I'm going to create I'm going to cut out the video right now and create the other levels and go back and show you the levels that I have created but you have plenty of info for you to create your own levels.</p>
<p>A quick note you don't have to create the same levels as I did you can create you can create levels on your own which is a good practice and I encourage that every single time.</p>
<p>So again for this spikes when we you know touch them we are going to die but we will see that later on.</p>
<p>Do not worry about that right now.</p>
<p>And basically that's it every single level that you create is going to inherit from level one.</p>
<p>I'm going to cut out the video right now and I'm going to continue just remember when you add spikes you're going to add them as child actor components.</p>
<p>So from here you're going to filter for the child actor when you select the child actor over here we're going to select the spikes for that child actor.</p>
<p>And that would be it.</p>
<p>That will be basically it.</p>
<p>So I don't have any the NX anything nx I don't have anything else clever to say I don't know how to talk I will see in a few when I create the other level parts and I am back Did you miss me because it took me a while to create all this of course for you it was a few moments but you know if you didn't miss me then you can watch this video anymore.</p>
<p>I'm just getting anyways here we have the level 6789 and 10 so this is my level six as you can see you can also download the complete project I have provided that under the you know importing or creating the project video you can you know download the assets or basically the complete project as well and see that on your own or you can create your own levels which I highly encourage you to do but basically this is my life.</p>
<p>Six as you can see so we have a cube here and two spikes Next we have the level seven which is very simple as you can see I'm not even moving the collision box or the trigger box and the spawn position they're staying at the same spot where they are in level one and I'm just you know moving the cube resizing it adding here child actors which are the spikes over here I have the level eight as you can see this is my level 8123 There you go till three boxes or T three cubes that is level nine There you go.</p>
<p>We have a spike in this weird thing over here the L shape if your name is Lauren, then you know this is for you, Lauren, and over here we have the level 10 There you go.</p>
<p>And that's all there is to it compile and safe.</p>
<p>I cannot say anything else or I don't have anything else clever to say.</p>
<p>Except if something is not clear.</p>
<p>Make sure that you ask in the comment down below.</p>
<p>And yeah, I will see you in the next video you know, where else can I see you, you know, I don't live where you live, I don't know you in person.</p>
<p>So I cannot see you, you know in your home.</p>
<p>I can see in the next video.</p>
<p>So again, if something's not clear, as gone below, I'll see you in next video.</p>
<p>Alrighty, then my game dev elf.</p>
<p>So let's go here in the c++ class, I'm going to right click and create a new c++ class inherit from the actor and this one is going to be my spawn level.</p>
<p>So spawn level level spawner, however you want to name it, I do not care.</p>
<p>You can name it car, you can name it, same name as your grandma, that is up to you, I cannot control you.</p>
<p>Okay, I named it spawn level.</p>
<p>And this is going to be the class that is going to allow us to spawn all of these levels.</p>
<p>But before we actually can do that, we of course need to add a few things inside of that class.</p>
<p>But first things first, you know, the SSD drive is still not there.</p>
<p>I think I will finish this recording today, which is Saturday for me, I don't know which day is for you.</p>
<p>And there we go.</p>
<p>Some info that we don't need.</p>
<p>So here we have the spawn level CPP and spawn level dot h.</p>
<p>So what's going to happen in the spawn level dot h, first things first here above below the includes, I am going to add my a base level class, because we are going to have levels that we are going to put inside of this inside of the spawn level.</p>
<p>So over here, I am going to create another public like this.</p>
<p>I know it's right below the public.</p>
<p>This is how I differentiate my own variables, I like to group them and that's all there is to it.</p>
<p>So over here, I'm going to create a u function like that.</p>
<p>And this is going to be my void spawn level, which is going to take a Boolean is first meaning is this the first level that we are going to spawn, we're also going to have our own on begin overlap.</p>
<p>So I'm going to go here inside of our player character and simply grab it from here so that I don't have to write all of these parameters and all of that stuff, you get the point it can be a little bit tedious, it can be a little bit you know, whatever.</p>
<p>So there you go.</p>
<p>So just go from the player and grab it copy and paste it is the same signature, the same name and everything.</p>
<p>Next over here we are going to have protected.</p>
<p>And for the protected, we are going to first have a player who is upon and it's a pointer and I'm going to call him player, we are going to get a reference to the player.</p>
<p>Next over here, I'm going to create a new property, your property which is going to be added anywhere.</p>
<p>So we will be able to edit it from the blueprint itself and is going to be a T sub class of a base level and is going to be our level one.</p>
<p>And this is the reason why I have imported this over here.</p>
<p>So don't worry if you don't have those autocompletes I mean, I don't have them.</p>
<p>As you can see, the reason for that is simple because Unreal Engine is slow.</p>
<p>And you know, reading all of this and the SSD drive is still not here.</p>
<p>So over here we have the level two and we have the level three, come on level four, come on level five, you can see you know, some not everything about the game that is, you know, fun and all of that stuff.</p>
<p>Some things are a little bit tedious for you and me to do but hey, you sign up for this, I did not you know, I didn't threaten you or whatever didn't force you.</p>
<p>So this is all on you.</p>
<p>Next year we're going to have a T array or simply an array of a base level who are pointers, and there's going to be my level list.</p>
<p>And last but not least, we are going to have also public variables one is going to be a random level because we are going to randomize the spawning of the level.</p>
<p>We are also going to have an F vector which is going to be our spawn location for the level and I'm going to call here f vector simply like that.</p>
<p>We're also going to have the F rotate tour and this is going to be our spawn rotation again f rotate or simply declare it over here and our f x spawn parameters which is going to be our spawn info was going to be equal to again simply copy this over here so that I can declare it because these are the variables that we are going to use over and over.</p>
<p>And Ctrl Shift to build this bad boy because you know, I need to build it okay.</p>
<p>And yeah, that will be its Let us wait for it a moment or two.</p>
<p>And there you go.</p>
<p>We have something over here I believe function public static void.</p>
<p>Expect struck Oh, okay.</p>
<p>Okay.</p>
<p>Okay.</p>
<p>I didn't actually, you know, declared these do so right click quick actions and refactorings create the definition.</p>
<p>Simple.</p>
<p>Right click Actions and refactoring create the definition.</p>
<p>Again, very simple, but yet, you know, people are forgettable, they tend to forget things as you just saw that.</p>
<p>I cannot wait for that SSD to arrive, man.</p>
<p>It's like, you know, I'm waiting for a new life, like I die that I'm not waiting to live again.</p>
<p>So yep, I'm going to sing to you.</p>
<p>Let me take my Oh, Colin 18 Union union union union union.</p>
<p>I'm kidding, I don't have a ukulele.</p>
<p>I don't know what that is.</p>
<p>I just heard that word.</p>
<p>And I told you that Okay, so over here, let me just now compile this.</p>
<p>And you see only now we see you know, different colors of everything that we have declared and stuff like that.</p>
<p>But now the you know, completion or the build has succeeded.</p>
<p>There you go.</p>
<p>So now inside of the spawn level, we are going to include or add our includes.</p>
<p>So we are going to have over here include base level that age, though that is one of the includes the next include is going to be our engine dot age.</p>
<p>So we're going to use the whole engine.</p>
<p>And the last include is going to be our components, box component dot h like that.</p>
<p>There you go.</p>
<p>And I don't know why it's giving me here a red because you know, it's included the same thing.</p>
<p>So what do we need to create here, inside of our spawn level, is where the main thing the main magic is going to happen.</p>
<p>So over here, what I'm going to do, I'm going to say spawn location is going to be equal to f vector.</p>
<p>And over here, I'm going to say 0.0, f 1000 for the y and 0.0, F for the z, y 1000 will because 1000 units is or 1000 centimeters is how large the level is because we you know, set the level to be 10 scale on the x axis, I believe, I think was x axis I cannot remember.</p>
<p>But anyways, it's 1000 units, which means that when we have one level over here, if we want to place another level over here, that's 1000 units, that's all there is to it.</p>
<p>Next we have the spawn rotation, which is going to be equal to f rotate or, and it is going to be zero here, 90 here and zero here, so on the Y where simply and wrote a shit like that.</p>
<p>So 90 on the y and there you go.</p>
<p>What I'm also going to check over here, or perform a check if this is not the first time we're spawning, so if not his first which is basically the parameter that we are going to pass here when we spawn the first level we are going to say this is true.</p>
<p>But for all other levels, this is not going to be true.</p>
<p>So if it's not the first level, then I'm going to say here a base level which is a pointer, last level I'm going to get the last level I'm going to say level list.</p>
<p>And that last and this is from the array of the level list where I'm going to get the last level and the reason for that is because now I'm going to say spawn location.</p>
<p>So spawn location is going to be equal to last level.</p>
<p>And from here I'm going to say get spawn location.</p>
<p>And from there I'm going to get the component transform component transform, and from there I'm going to say dot get translation There you go.</p>
<p>And if I can finish the statement, if I hover over it says returns the translation of the component basically it will return the position of our spawn location and notice here I'm using get spawn location if you remember in our base level over here, we're getting the spawn location by returning it Look at that get spawn location, we're returning the spawn location and if you double remember inside of the blueprint for that so if I go over here inside of the blueprints and the level and over here, we are setting the spawn location to be equal to this one which is this bad boy over here and this is that spawn location.</p>
<p>So we are going to get that value that reference here.</p>
<p>And from there, we're going to know where is the last position of the last level.</p>
<p>So next over here, I'm going to randomize this, I'm going to say a random level is going to be equal to f math, call on call on.</p>
<p>And I'm going to use a Rand range between one and 10, which is going to return numbers between one and 10, including both of these.</p>
<p>And then I'm going to say a base level, which is a pointer, new level, by default is going to be equal to null PTR.</p>
<p>So null pointer, but now I am going to test for the random level.</p>
<p>So if our random level is equal to one like that, then I'm going to say new level, which is the one that we have just created over here, that is going to be equal to get the world.</p>
<p>And from the world, I'm going to spawn an actor, which is a type of base level.</p>
<p>So this is going to be the actor that we're going to spawn and we're going to spawn the level one actor at the spawn location, using the spawn rotation, throwing bars at the Mars and and over here, we're going to use the spawn info.</p>
<p>So spawn in felt like that.</p>
<p>There you go.</p>
<p>And simply now I can copy this, and I can say, Here else, and paste this over here.</p>
<p>If the random level is equal to do then over here, I'm simply going to spawn level two, that's all there is to it, we need to read and we need to need to, why am I saying limini, we need to repeat this process.</p>
<p>So again, this one is three.</p>
<p>Now over here, we need to spawn the level three, going back over here, as I said, Sometimes things can get tedious over here, random level four, over here and the level four, of course, we can do this, you know, I mean, we need to do it, I don't know what I wanted to say, anyways, six now.</p>
<p>And over here, there you go six, over here, now Come on, are going to have 7789 and 10.</p>
<p>And we're done.</p>
<p>So don't Don't cry, don't be a cry, baby, and all of that stuff, be patient.</p>
<p>Imagine how I felt when I created all of this, you know, so yeah, there we go.</p>
<p>The last one is here.</p>
<p>And finally, we are done.</p>
<p>So down over here, spawning the 10 over here.</p>
<p>So based on the as you can see, based on the random level that we have over here, then we are going to, as I said, this is going to return either one or 10 or numbers in between.</p>
<p>So based on those numbers, then we are going to set the new level which is currently at null pointer to be equal to one of these levels.</p>
<p>If it's one, then level one than dude and three, you get the point.</p>
<p>But if something is not clear, make sure you ask in the comment down below.</p>
<p>Over here what I'm going to do if we have a new level, we need to perform this test because otherwise, if this gets to an old pointer, but of course there is no chance that this will get to an old pointer because over here where you know the randomized numbers are from one to 10.</p>
<p>And we're testing for all of them.</p>
<p>But if we have a level, then we are going to say if new level and from here I'm going to get the trigger.</p>
<p>So I'm going to get the trigger from the new level again, what is this new trigger if or getting the trigger if you remember from the base level over here, we are getting the trigger we're returning that the trigger is again, the huge box over here, this is the trigger where the player needs to pass by so if the player passes by this trigger, then we are going to spawn new levels.</p>
<p>Simple as that very, very simple.</p>
<p>So if I go back over here, so if we can get the trigger, then we're going to say new level and from there gets the trigger.</p>
<p>And from the trigger we are going to say on component begin overlap dot now we are going to add the dynamic which is basically we're going to assign a function that will be executed when we begin that overlap.</p>
<p>So I'm going to say this, and from here I am simply going to copy this and I'm going to say and and paste this over here.</p>
<p>So essentially, when we collide with the trigger of the level, the one that I showed you a moment ago, we are going to call the on overlap begin from over here from the spawn level.</p>
<p>And over here, what we are going to do is we're going to call spawn level, passing false to spawn a new level, simple as that.</p>
<p>So it's going to pass or go through all of this over here same as what we did right now go through it, and then it is simply going to spawn a new level And basically that's all there is to it, that's pretty much all there is to it, nothing, you know more.</p>
<p>And over here, inside of our on Begin Play, we need to spawn the level.</p>
<p>So spawn level and over here I'm going to say true.</p>
<p>But I'm going to copy this because the first one is going to be true and the next three are going to be false over here false.</p>
<p>Let me just copy paste, copy, paste, let me just compile this and make sure that we don't have any problems and issues because you know, this is coding I am you know, I cannot code according to some of the comments.</p>
<p>So it can happen that I miss something and all of that good stuff.</p>
<p>So essentially over here in the and while this is compiling, I'm going to try and explain what is going on.</p>
<p>So over here, we have created a spawn level function that is going to spawn new levels, we have the spawn location, we have the spawn rotation.</p>
<p>And over here if it's not the first, because when we spawn, the first one, we're going to say it's true, but for all others is going to be false.</p>
<p>So if it's not the first level platform that is going to be spawned, then we're going to get the last level inside of our level array.</p>
<p>And we of course need to add, which is one thing that we need to do at the end, so we need to add our level to the level list.</p>
<p>So we're going to get the last level from the level list and then we're going to get its location of the spawn location which is a component that we added.</p>
<p>So we're going to get its location and know from where we should spawn the next level.</p>
<p>Over here we're going to randomize the value so from one to 10, and if that random value is equal to one, we're going to spawn level one if it's to level two, and so on up to level 10 over here as I said, I did forget so if we have new level after that, so we are going to attach a dynamic and what the hell is this again when I save the seed saving because it's processing everything gold this year.</p>
<p>So again, if we have a new level and we do all of this over here so we get the trigger from the level we attach the on component begin overlap we add that to the dynamic spawn level and all of that good stuff.</p>
<p>Then over here I'm going to say level list dot add and I am going to an over here it's actually level list like that and capital A and I'm going to add the new level so new level there you go.</p>
<p>But I am not going to allow to have more than five elements inside of the level list.</p>
<p>So over here I'm going to test if our level list dot num so if the length or how many elements we have in that level list is more than five then from there I'm going to say level list dot remove add and I'm going to remove the last element inside of that level list.</p>
<p>Now the bad news is that this still did not compile and the even more worse news is that we need to compile it again.</p>
<p>So I'm probably going to cut out the video right here until the SSD drive arrives and I'm going to continue from the you know when this compiles but again here at the end what we did is we added the new level to the level list so that we you know next time when we try to get the last level we will actually have it so we will not have an empty list but we will have a level inside of that list and we are checking if the elements or how many elements are inside of that level list.</p>
<p>If that number exceeds five then we're going to remove the element that's at index zero meaning the first level that's there so that's all there is to it and I will see you in a few when this compiles and I am back we have a problem over here that is the reason why this was yelling at me so here spawn rotation I do need to declare this as spawn rotation and all here for every single level I need to add that to spawn rotation so spawn location here spawn rotation, there you go.</p>
<p>Here it's bond rotation, rotation rotation, stupid misspelling, I really cannot wait for that SSD drive to arrive you know I'm saying this SSD drive over and over again in hopes that some of you guys will send it to me but you know apparently nothing will come out of it so I need to rebuild this again but this time I think it will be faster because it rebuild it at once so it you know went through that whole process and you know, it now knows it can go faster because we for sure waited a little bit.</p>
<p>Well, a little more bit for all of this to reload.</p>
<p>Anyways, come on.</p>
<p>Let us wait and now there we go build has succeeded.</p>
<p>Finally, finally, finally.</p>
<p>If something was not clear in regards to this one and I've explained it two times, make sure that you ask in the comment down below because now we need to move on and go here inside of our blueprints and right click and create our levels bahner who who is going to you know, inherit from the level or spawn level Sue spawn level there you go.</p>
<p>From here I need to say BP spawn level and go inside and attach all of these levels so we need to attach all of these levels so from here, we need to take level one, then level two, then here we have level three and all of that good stuff so the tedious part that nobody likes to do but everybody likes to play the game.</p>
<p>So eight and nine and last but not least here is our level 10 and we need to Compile and Save that so now I can go here in the gameplay and I can simply put my level spawn or I can put him here 000 It does not matter what matters is if I hit the play button that he will spawn the levels and indeed he did there you go look at that all of the levels I can possess the character and now I can run and every single time we you know pass the trigger, we will spawn new levels as you can see over here we have infinite number of levels and every single time you see they're differentiated Look at that, then I can run and all of the good stuff and yada yada yada you get the point.</p>
<p>So there you go.</p>
<p>As you can see we can run infinite the leap so the last step is to add our wall that is chasing us that is going to kill us that we need to and there we go for whatever reason why these levels huh this was for the I need to redo the level or recheck this level that has these two I probably need to reposition the oh actually no, I don't need to reposition but I need to make that trigger a little bit larger because we jumped over it and that is the reason why that is the reason why we did not have new levels so we need to make sure that the trigger is a little bit larger because again here is the level you see we just need to make sure that the trigger is larger on every single level that is so make sure and since we are inheriting from the level one we can I believe go simply over here inside of the levels level one there we go and make this over here the trigger box a little bit larger so I don't know let's say 20 something like that so it will not allow it and we can move it there you go so now the player has no chance five to five is going to be the position for it unit 530530 and Compile and Save that and I believe it will change it for every single level yes it will there you go it will change it for every single level.</p>
<p>So as I said now the player will not be able to jump over it and it will not give us the problem that we just had of not having the level so now even if I go from here and I tried to jump way over here I'm still going to create new levels there you go.</p>
<p>So if something was not clear in regards to this video just ask I will not answer and just kidding I will answer and help you out.</p>
<p>And that will be it for this video I will see you guys in the next one we're going to create our wall that is going to start to chase us and all of that stuff and then we are going to wrap up our game see it then All righty then my game Deaf gangsta Roni owes Let us wrap up our game so going here inside of our c++ classes are going to create a new c++ class but this one is going to inherit from the spike so I'm going to click here show all classes and filter for our spikes it's it's not spike spike just it spikes there you go and this one is going to be our wall spike There you go.</p>
<p>And what's gonna happen inside of this class is I am not going to do basically anything in the dot h file but of course we need to you know go through the painful process of all of this man send me that SSD What else can I say? I'm waiting for it just kidding in a few days it will come to in the next tutorial we'll be ready and this is going to be fast as as as a as something that is fast, I don't know a squirrel.</p>
<p>So in the wall, let's go over here reload everything first wall spike that age, I'm not going to do anything but in the dot cpp file we are going to do something.</p>
<p>So over here basically in the dot h file we are going to have all of the you know basic so we have the generated body we are going to have a public over here we're going to have a wall spike which is our constructor in the protected so protect that.</p>
<p>We are going to have our virtual void.</p>
<p>So virtual void Begin Play because we want to override it.</p>
<p>So override in our public, we're going to have our.</p>
<p>So from here, it's going to be virtual, void, tick, and it's going to be float Delta time.</p>
<p>And over here, override, there you go.</p>
<p>Because now in the dot cpp file, we are going to implement all of that.</p>
<p>So over here, we are going to say a wool spike colon colon, and is going to be our a will spike basically the constructor.</p>
<p>And over here, we're going to have our primary actor tick that B can ever tick is equal to true.</p>
<p>So we're going to enable that also over here in our void, a wall spike call on call on is going to be our begin.</p>
<p>So it's begin blay.</p>
<p>What's going to happen over here, first, you're going to call the super, which is the superclass and call the Begin Play from there.</p>
<p>So begin, play.</p>
<p>There you go, actually begin play like this.</p>
<p>And then from here, what I'm going to do is it's not being it's begin play like that Begin Play, I'm going to say this, and I'm going to get the root component from our blueprint, and I'm going to say component, so component velocity, and we just said that F vector, zero for the X 25 for the y and zero for the Z.</p>
<p>So this is the velocity, or basically the speed of our of the actor.</p>
<p>And next, I'm going to say Boyd, a wall spike with double or capital W spike, call on call on tick.</p>
<p>And over here, we're going to have the Delta time, like that.</p>
<p>So what's going to happen over here again, first, I'm going to call the super dick.</p>
<p>So super dick, which is going to take the Delta time and I know you're expecting me to do some jokes, oh, you're tick.</p>
<p>Look, I'm not Danny, I'm not trying to be Danny, I don't care, you know, I'm not going to do the tick joke and whatnot, said actor location.</p>
<p>And from here, I'm going to get the actor location, which is the current location of this actor, and I'm going to add to it on F a vector.</p>
<p>And inside of this F vector, I'm going to say zero for decks 350 for the Y, multiplied with Delta time, delta time.</p>
<p>So it's Delta time, there you go, and zero for the Z.</p>
<p>And over here, I'm going to say true.</p>
<p>And that's all there is to it.</p>
<p>So let me just compile this and we can make sure that everything is okay, we don't have any issues.</p>
<p>Essentially, what we did over here is inside of our Begin Play, there we go succeeded we are good.</p>
<p>In on Begin Play, we set the component velocity of the root component to be 25 on the y and then over here, inside of the tick, we are moving the actor by using its current location and adding to it only the Y here because x and z are zero, that means they will not move and we're adding to it's 350 multiply with Delta time, of course, you can set a public variable speed or something like that.</p>
<p>That is, you know, up to you if you want to do that.</p>
<p>I'm not going to do it.</p>
<p>But yeah, there we go.</p>
<p>So let's go inside of the editor.</p>
<p>And inside of the blueprints that I'm going to go in the obstacles and right click and create a wall obstacle.</p>
<p>So I'm going to say well spike, because it is going to inherit from the wall spike BP will spike and we need to edit this, we need to edit it to look like a wall.</p>
<p>So over here, I am going to filter for the static mesh that I'm going to call walls simply over here for the Static Mesh which is going to be our cube I'm going to say cube like that.</p>
<p>There you go.</p>
<p>And here basic shape material Wallah.</p>
<p>I'm going to change you know the scale so the y and the Z scale are going to be 10.</p>
<p>This is it.</p>
<p>Over here for our presets you see it's set to block all dynamic instead over here and we'd say no collision.</p>
<p>Now the reason for that is because I'm going to detect collision with a box Collider.</p>
<p>So I'm going to here go here and I'm going to say bar collision.</p>
<p>And simply call it box you can call it box or however, and for this one, I am going to set the x scale at three y scale is going to be 20 and the Z scale is going to be 20.</p>
<p>And with this one I want to detect collision with our player.</p>
<p>And in order for me to do that, I'm going to scroll down over here where it says for the collision presets and I am going To set this one to the custom collision, over here, I'm going to say query only no physics collision.</p>
<p>So basically no physics collision over here for the world dynamic, I'm actually going to set this to spike, because the spike will be able to collide with the player, Compile and Save that now in order for us or for this to work, we are going to go in our player, which is this one, let me just close these levels.</p>
<p>So closing, all of the levels Come on, there you go.</p>
<p>For the player, I'm going to select his capsule component and scroll down over here for the collision preset, it is set to be a custom one end it is said to be upon.</p>
<p>So this is what we need to do, we'll set it to be a custom one, set it to be upon make sure that it is overlapping the spike, because that is what we need.</p>
<p>So we need it to overlap the spike.</p>
<p>Now what we need to do is go over here inside of our game, and we are going to add our wolf spike, here he is, and let me just reposition him.</p>
<p>So the exposition is going to be minus 30, the Y is going to be minus 830 and the Z it's 455.</p>
<p>And of course, I'm also going to rotate it 90 degrees on the so 90 degrees on the z axis.</p>
<p>If I hit the play button now There we go, you see, it is going it is trying to search for us or actually trying to get us if it catches us looking now is simply going to pass through us we're not detecting collision in the code.</p>
<p>This is why we don't see anything.</p>
<p>So we need to detect collision in the code for anything to happen.</p>
<p>But the point that I wanted to show you is that it is not the tech thing.</p>
<p>It is not a solid object, it simply passes through.</p>
<p>So how can we detect collision with the player I don't want to leave that in the next video.</p>
<p>Instead, I'm going to do it right now I can leave it in the next video, but I'm going to do it right now.</p>
<p>So going back over here inside of our runner character CPP at the top here, so inside of Begin Play after or before we set can move to be true, we need to get the capsule component so we need to say get capsule component which is a component the capsule component of the player that we have just edited.</p>
<p>You know the one that I said it, it needs to be upon.</p>
<p>So from there, I'm going to see on component begin overlap dot and I would say add dynamic.</p>
<p>And over here we're going to add this and I'm simply going to go down and copy the name over here so that we don't have to, you know, type it out.</p>
<p>So and and that there you go.</p>
<p>So this is going to take that capital component from the player, which is you know, in the blueprints, so taking that capsule component, then it is going to attach to it are on begin overlap or on overlap begin.</p>
<p>So essentially what's going to happen inside of this one is that we are going to detect if we have collided with a spike or a wall spike.</p>
<p>So over here I'm going to say if the other actor is not equal to no PTR.</p>
<p>So it's PTR, not TPR.</p>
<p>It's PTR other actor is basically the actor, the other one that we have collided with inside of our game.</p>
<p>So if it's not equal to no we have collided with some of the actors then we're going to say a spike like that, or spikes which is a pointer.</p>
<p>And I'm going to say here walls spikes There you go, or wall spike and that is going to be equal to I'm going to cast that to a wall spike like that and I'm casting the other actor.</p>
<p>Now we don't have the completion or anything because we do need to go here on top and right here we need to include a few things so we need to say include our spikes dot h file, we also need to include our wall spike dot h file and last but not least, we need to include the engine.</p>
<p>So it's engine dot h because we are going to restart the game when the player dies in order for us to do that.</p>
<p>Then we need to use the engine and there we go over here our spikes wall spike we're going to do that or try to cast that next I'm going to say a spikes and over here because it's a pointer spike and I'm going to cast it into a spike like that then I'm casting again the other actor same as what I did be for naturally here it spikes not spike.</p>
<p>So essentially if we collide with either the wall so if wall spike or we have the spike.</p>
<p>So if we collide with any of these meaning they are not not so essentially over here what we are trying to do we are casting the other actor to the wall spike And other actor to the spike spike basically.</p>
<p>So below over here we're testing if we have a wool spike, or if we have a spike, meaning they're not equal to null, that means we collided with one of the two, that means game over.</p>
<p>So now I'm going to say get mash, which is going to get the mesh of our character, and then I'm going to deactivate that mesh, I'm also going to say get mesh.</p>
<p>And from here, I am going to say set visibility for that mesh to be false so that we don't see it anymore in the game can move is now equal to false, we cannot move anymore.</p>
<p>And next we are going to reload the level after two seconds.</p>
<p>And for that we need to create f timer handle I'm going to say on used so on used handle like that.</p>
<p>And I'm going to say get world timer manager.</p>
<p>And from there, I'm going to say set timer.</p>
<p>And I'm going to pass the unused handle so on use the handle into this and then I am going to pass this function which is our runner re start level.</p>
<p>So over here and passing the restart level passing over here too, because after two seconds, I want that to restart and over here I'm going to say false because I don't want this to loop and be an infinite loop and spawn over and over and over again.</p>
<p>The last step over here is inside of our restart level, we simply need to call you gameplay statics.</p>
<p>So check out the statics and over here, open level.</p>
<p>And simply we can pass the name of the level or we can do this, I can pass this and I can say the name of the level instead of passing the name.</p>
<p>I can say here with a star get world like that.</p>
<p>And over here get the name there you go.</p>
<p>And voila, this world is going to get the name of the current level that we are in and it is going to paste it over here I'm going to compile this and while I'm compiling I am going to explain what is going on inside of here.</p>
<p>I don't think there is nothing to explain because we already explained that inside of our runner character we attached here the on begin overlap for the capsule collider.</p>
<p>That's everything what we did.</p>
<p>And over here we're testing if we have the other actor, meaning we have collided with something so the other actor is not equal to null and there we go, the build has succeeded.</p>
<p>So our game is done.</p>
<p>And over here we have the other act and we have collided with something.</p>
<p>So try to cast that other actor into a wall spike or a spike, basically meaning try to test if the other actor is the wolf spike or if the other actor is the spike.</p>
<p>Is that true is that the case basically this is what we're asking.</p>
<p>And if we have either of these so if we have a wolf spike or we have a spike meaning they're not equal to No, we are going to get the mesh and the activated we're also going to set the visibility of the mesh to false so that we don't see it anymore we cannot move inside of our game so that when we press the buttons we will not be able to move because over here if you remember only if we can move now we're going to have the move add the movement to the player and then over here we're going to restart the level this is the signature how you restart the level so we need to pass this timer handle even though we're not using it passing this referring to this class this is the function I want to be called after two seconds and no I don't want it to loop I don't want it to repeat over and over again and over here simply calling gameplay statics open level passing the level name to reload the level and that's pretty much it we are done so if I hit the play button right now when we you know collide with the spikes or this wall so now when the wall touches me there we go the character has disappeared now we restarted the level and if I collide with one of the spikes So come on let's try here is one of the spikes there you go bam.</p>
<p>I've also died and there we go.</p>
<p>This is our game Let's try it out again again let's run Let's run anyways you get the point.</p>
<p>Congratulations for making it till the end of this game.</p>
<p>If you liked this video, hit the like button and subscribe to the channel all the good stuff because it will help me out you know I'm trying to spread the word about my wisdom and just kidding but anyways, you get the point.</p>
<p>So I don't have anything else to say.</p>
<p>If you like this, you have more tutorials in my game development Academy.</p>
<p>Thank you for watching again and I will see you guys in the next video. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Make a Video Game – Create Your Own Game From Scratch Tutorial ]]>
                </title>
                <description>
                    <![CDATA[ Game development is a popular field within the software industry. But what does it take to start building games from scratch? In this article, I will talk about the different game engines and tools that you can use to build your own games. I will als... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-make-a-video-game-create-your-own-game-from-scratch-tutorial/</link>
                <guid isPermaLink="false">66b8d99498b552b8a8592b26</guid>
                
                    <category>
                        <![CDATA[ Game Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ unity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Video games ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Tue, 12 Oct 2021 15:34:31 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/10/branden-skeli-r4YWfVVwTQ8-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Game development is a popular field within the software industry. But what does it take to start building games from scratch?</p>
<p>In this article, I will talk about the different game engines and tools that you can use to build your own games. I will also provide you with dozens of resources and tutorials to help get you started.</p>
<p>There are many tools and game engines out there but I will cover a few of the popular ones. </p>
<ol>
<li><a class="post-section-overview" href="#heading-unity">Unity</a></li>
<li><a class="post-section-overview" href="#heading-unreal">Unreal Engine</a></li>
<li><a class="post-section-overview" href="#heading-godot">Godot</a></li>
<li><a class="post-section-overview" href="#heading-phaser">Phaser</a></li>
<li><a class="post-section-overview" href="#heading-gamemaker-studio">GameMaker Studio</a> </li>
<li><a class="post-section-overview" href="#heading-cryengine">CryEngine</a></li>
<li><a class="post-section-overview" href="#heading-amazon-lumberyard">Amazon Lumberyard</a></li>
<li><a class="post-section-overview" href="#heading-renpy-visual-novel-engine">Ren'Py Visual Novel Engine</a></li>
<li><a class="post-section-overview" href="#heading-pygame">Pygame</a></li>
<li><a class="post-section-overview" href="#heading-love">LÖVE</a></li>
<li><a class="post-section-overview" href="#heading-kaboomjs">Kaboom.js</a></li>
</ol>
<h2 id="heading-unity">Unity</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-1.47.43-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This is a cross platform video game engine that is popular with game developers. Unity supports many platforms including iOS, Android, Windows, Mac, Linux and game consoles such as PlayStation and Xbox.</p>
<p>Some popular games that have been built with Unity include Cuphead, Pillars Of Eternity, Ori And The Blind Forest, Escape Plan, and Hearthstone. </p>
<p>Unity provides you with the opportunity to create your own 2D and 3D games. You can create shooter games, platformer games, educational games and more with Unity.</p>
<p>The programming language used with Unity is C#. If you are new to C#, you can take <a target="_blank" href="https://www.youtube.com/watch?v=GhQdlIFylQ8">this freeCodeCamp YouTube course</a>. </p>
<p>To get started with Unity, you can sign up for a free plan on their website. They offer <a target="_blank" href="https://store.unity.com/#plans-individual">free plans</a> for both students and individual use. </p>
<p>Unity also provides hours of courses, project tutorials, live training sessions and certifications. All of this education is available on their <a target="_blank" href="https://unity.com/learn#explore-how-you-can-develop-your-skills--2">website</a>. </p>
<p>freeCodeCamp also provides many resources to help you get started.</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/game-development-for-beginners-unity-course/">Game Development for Total Beginners - Free Unity Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-unity-multiplayer-basics-with-mirror/">Learn Unity Multiplayer Basics with Mirror</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-c-and-unity-by-making-digital-tabletop-games/">Learn C# and Unity by Making Digital Tabletop Games</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/unity-game-engine-guide-how-to-get-started-with-the-most-popular-game-engine-out-there/">Unity Game Engine Guide: How to Get Started with the Most Popular Game Engine Out There</a></li>
</ul>
<h2 id="heading-unreal">Unreal</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-1.56.37-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Unreal is a game engine where you can build 3D games. Unreal supports many platforms including iOS, Android, Windows, Mac, Linux and game consoles such as PlayStation, Xbox and Nintendo Switch.</p>
<p>Popular games built with the Unreal game engine include Fortnite, Yoshi's Crafted World, Hellblade: Senua's Sacrifice, Street Fighter 5, and Star Wars Jedi: Fallen Order. </p>
<p>The programming language used with Unreal is C++. If you are new to C++, you can take <a target="_blank" href="https://www.youtube.com/watch?v=vLnPwxZdW4Y">this freeCodeCamp YouTube course</a>. </p>
<p>You can download the Unreal game engine for free on <a target="_blank" href="https://www.unrealengine.com/en-US/download">their website</a>. They also provide 100's of hours of <a target="_blank" href="https://www.unrealengine.com/en-US/learn">free online tutorials</a>.  </p>
<p>freeCodeCamp also provides many resources to help you get started.</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-unreal-engine-by-creating-three-games/">Learn Unreal Engine 4 by Coding 3 Games - A Free 5-hour Game Dev Video Course</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/unreal-engine-course-create-a-2d-snake-game/">Unreal Engine Course: Create a 2D Snake Game</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/create-a-2-5d-platformer-game-with-unreal-engine/">How to Build A 2.5D Platformer Game With Unreal Engine – a Free 3-hour Course</a></li>
</ul>
<h2 id="heading-godot">Godot</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-2.36.55-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Godot is a free open source game engine designed to create 2D and 3D games. Godot supports many platforms including iOS, Android, Windows, Mac, and Linux. </p>
<p>Some popular games that have been built with Godot include Carol Reed Mysteries, Commander Keen in Keen Dreams, and Cruelty Squad. </p>
<p>Godot supports a few programming languages but the main ones are GDScript and VisualScript. To learn more about supported languages, please visit the <a target="_blank" href="https://docs.godotengine.org/en/stable/getting_started/step_by_step/scripting.html">documentation</a>.</p>
<p>To get started working with Godot, you can go to their <a target="_blank" href="https://godotengine.org/download">download page</a>. Godot provides many free tutorials in their <a target="_blank" href="https://docs.godotengine.org/en/stable/">learn section</a>.   </p>
<p>freeCodeCamp also provides <a target="_blank" href="https://www.freecodecamp.org/news/create-a-2d-platformer-game-using-the-godot/">this YouTube tutorial</a> on Godot. </p>
<h2 id="heading-phaser">Phaser</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-2.58.38-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Phaser is a free open source platform where you can build HTML 5 games for mobile and desktop. Phaser supports iOS, Android, as well as like Apache Cordova and phonegap.</p>
<p>Phaser provides you the opportunity to create your own shooter games, platformer games, educational games, and more. The primary languages used are JavaScript and TypeScript. </p>
<p>If you are new to either of those languages you can look into these freeCodeCamp beginner tutorials. </p>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=PkZNo7MFNFg">Learn JavaScript - Full Course for Beginners</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=gp5H0Vw39yw">Learn TypeScript - Full Course for Beginners</a></li>
</ul>
<p>To get started working with Phaser, you can go to <a target="_blank" href="https://phaser.io/download">the download page</a> on their website. Phaser offers dozens of <a target="_blank" href="https://phaser.io/learn">free tutorials</a> to help you get started creating your first games. </p>
<p>If you have experience working with Node, Express, Vue or Socket.IO, then you can look into these tutorials. </p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-build-a-multiplayer-tabletop-game-simulator/">How to Build a Multiplayer Tabletop Game Simulator with Vue, Phaser, Node, Express, and Socket.IO</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/how-to-build-a-multiplayer-card-game-with-phaser-3-express-and-socket-io/">How to Build a Multiplayer Card Game with Phaser 3, Express, and Socket.IO</a></li>
</ul>
<h2 id="heading-gamemaker-studio">GameMaker Studio</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-3.15.30-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>GameMaker Studio is a cross platform video game engine where you can create your own 2D games. GameMaker supports many platforms including iOS, Android, Windows, Mac and game consoles such as PlayStation and Xbox.</p>
<p>Popular games made with GameMaker Studio include Undertale: Overwhelmingly Positive, Shovel Knight: Treasure Trove: Overwhelmingly Positive and Katana Zero: Overwhelmingly Positive.</p>
<p>GameMaker Studio uses the GameMaker Language and you can learn more by visiting the <a target="_blank" href="https://manual.yoyogames.com/#t=GameMaker_Language%2FGameMaker_Language_Index.htm">documentation</a>. </p>
<p>They also offer <a target="_blank" href="https://www.yoyogames.com/en/tutorials">dozens of tutorials</a> to get you started making games. Gamemaker has a free option and you can <a target="_blank" href="https://accounts.yoyogames.com/register">create an account</a> on their website. </p>
<h2 id="heading-cryengine">CryEngine</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-3.32.14-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>CryEngine allows you to create interactive 3D games and supports platforms like Windows, Linux, PlayStation, Xbox, and Oculus Rift. You can create shooter games, platformer games, educational games and more with CryEngine.</p>
<p>Some popular games that have been built with CryEngine include Kingdom Come: Deliverance, Far Cry, State of Decay, and Ryse: Son of Rome. </p>
<p>Programming languages used for CryEngine include C#, C++, and Lua. If you are not familiar with those languages, then you can look into these resources. </p>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=GhQdlIFylQ8">C# Tutorial - Full Course for Beginners</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=vLnPwxZdW4Y">C++ Tutorial for Beginners - Full Course</a></li>
<li><a target="_blank" href="https://www.lua.org/pil/1.html">Lua Get Started Guide</a></li>
</ul>
<p>CryEngine has dozens of <a target="_blank" href="https://www.cryengine.com/tutorials">tutorials</a> to help you get started building games and it is free to <a target="_blank" href="https://www.cryengine.com/download">download</a> on their website.   </p>
<h2 id="heading-amazon-lumberyard">Amazon Lumberyard</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-4.03.19-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Amazon Lumberyard is a free cross platform video game engine where you can create your own 3D games. Amazon Lumberyard supports many platforms including iOS, Android, Windows and game consoles such as PlayStation and Xbox.</p>
<p>Some games using Amazon Lumberyard include New World and The Grand Tour Game. </p>
<p>Programming languages used for Amazon Lumberyard include C++, and Lua. If you are not familiar with those languages, then you can look into these resources.</p>
<ul>
<li><a target="_blank" href="https://www.youtube.com/watch?v=vLnPwxZdW4Y">C++ Tutorial for Beginners - Full Course</a></li>
<li><a target="_blank" href="https://www.lua.org/pil/1.html">Lua Get Started Guide</a></li>
</ul>
<p>Amazon Lumberyard is free to <a target="_blank" href="https://aws.amazon.com/lumberyard/downloads/">download</a> and there are dozens of <a target="_blank" href="https://aws.amazon.com/lumberyard/videos/">tutorials</a> to get you started building your own games. </p>
<h2 id="heading-renpy-visual-novel-engine">Ren'Py Visual Novel Engine</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-4.04.35-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Ren'Py Visual Novel Engine is a free engine where you can create interactive visual novels and games. Ren'Py supports many platforms including iOS, Android, Windows, Mac, and Linux.</p>
<p>Some popular games and novels created with Ren'Py include, Doki Doki Literature Club!, Zero Deaths, and UFO Swamp Odyssey.</p>
<p>The programming language used with Ren'Py is Python. If you are new to Python, you can take <a target="_blank" href="https://www.youtube.com/watch?v=rfscVS0vtbw">this freeCodeCamp YouTube course</a>.</p>
<p>You can <a target="_blank" href="https://www.renpy.org/latest.html">download</a> Ren'Py for free on their website. They also provide a <a target="_blank" href="https://www.renpy.org/doc/html/quickstart.html">Quickstart</a> guide to creating your first game or novel. </p>
<p>freeCodeCamp also has a walk through <a target="_blank" href="https://www.freecodecamp.org/news/use-python-to-create-a-visual-novel/">tutorial</a> on how to make a visual novel game using Ren'Py. </p>
<h2 id="heading-pygame">Pygame</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-4.15.49-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Pygame comes with modules, sounds, and graphics to allow you to create video games using Python. Pygame supports platforms including Linux, Mac and Windows. </p>
<p>Popular games built with Pygame include Frets on Fire and Dangerous High School Girls in Trouble!</p>
<p>The programming language used with Pygame is Python. If you are new to Python, you can take <a target="_blank" href="https://www.youtube.com/watch?v=rfscVS0vtbw">this freeCodeCamp YouTube course</a>.</p>
<p>To get started with Pygame, you can go through their <a target="_blank" href="https://www.pygame.org/wiki/GettingStarted">Getting Started guide</a> on their website. freeCodeCamp also has a <a target="_blank" href="https://www.youtube.com/watch?v=FfWpgLFMI7w">YouTube course</a> on getting started with Pygame. </p>
<h2 id="heading-love">LÖVE</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-4.25.28-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>LÖVE is a free game engine where you can build 2D games. LÖVE supports many platforms including iOS, Android, Windows, Mac, and Linux.</p>
<p>Some popular games that have been built with LÖVE include Blue Revolver, Move or Die, and Warlocks Tower. </p>
<p>The programming language used for LÖVE is Lua. You can learn about Lua in their <a target="_blank" href="https://www.lua.org/pil/1.html">get started guide</a> on the website. </p>
<h2 id="heading-kaboomjs">Kaboom.js</h2>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/Screen-Shot-2021-10-12-at-4.34.35-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Kaboom.js is a library that allows you to build computer games using JavaScript. If you are unfamiliar with JavaScript, then you can take this <a target="_blank" href="https://www.youtube.com/watch?v=PkZNo7MFNFg">freeCodeCamp YouTube course</a>.  </p>
<p>To get setup, you can use their CDN, NPM or official Replit template. All of the information to get started can be found on their <a target="_blank" href="https://kaboomjs.com/doc/setup">website</a>. </p>
<p>Kaboom.js also provides a walk through <a target="_blank" href="https://kaboomjs.com/doc/intro">tutorial</a> to building your first game. You can recreate classic games like Mario and Space invaders using Kaboom.js. </p>
<p>You can also go through <a target="_blank" href="https://www.youtube.com/watch?v=4OaHB0JbJDI">this freeCodeCamp YouTube course,</a> to get started building classic games. </p>
<p>I hope you enjoy my list of popular game engines and tools to get started learning how to build your own games. </p>
<p>I encourage to keep exploring and find even more game options that were not mentioned in this article so you can continue your learning. </p>
<p>Best of luck on your game development journey. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Build A 2.5D Platformer Game With Unreal Engine – a Free 3-hour Course ]]>
                </title>
                <description>
                    <![CDATA[ Unreal Engine is one of the most popular tools for creating 3D and 2D games. Blueprint visual scripting system for gameplay that makes creating games even easier. We've released a free course on the freeCodeCamp.org YouTube channel that will show you... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/create-a-2-5d-platformer-game-with-unreal-engine/</link>
                <guid isPermaLink="false">66b2016925ef0bb2c5a516f9</guid>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Tue, 07 Jul 2020 21:26:46 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/09/25d.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Unreal Engine is one of the most popular tools for creating 3D and 2D games. Blueprint visual scripting system for gameplay that makes creating games even easier.</p>
<p>We've released a free course on the freeCodeCamp.org YouTube channel that will show you how to create a 2.5D platformer game with Unreal Engine and Blueprints. The course was developed by Awesome Tuts.</p>
<p>You will learn how to make a ball move around, collect energy points, lose health, interact with the environment and items, and more. The game will act as a template that you can build upon and add your own features.</p>
<p>You are provided 3d assets to use in the game. These assets can be used for this game and for other games that you create.</p>
<p>This is a great overall tutorial if you want to improve your game development skills.</p>
<p>You can watch the full course on <a target="_blank" href="https://www.youtube.com/watch?v=9Fd9hw329fY">the freeCodeCamp.org YouTube channel</a> (3 hour watch).</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Become an Unreal Automation Expert ]]>
                </title>
                <description>
                    <![CDATA[ By Tim Grossmann Table of contents Automating Workflows with Blueprints, C++, and Python Why the Unreal Engine is interesting Why use Blueprints for workflow and even game programming Why use C++ for workflow and game programming Why use Python for ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/becoming-an-unreal-automation-expert/</link>
                <guid isPermaLink="false">66d4614937bd2215d1e245eb</guid>
                
                    <category>
                        <![CDATA[ automation ]]>
                    </category>
                
                    <category>
                        <![CDATA[ C++ ]]>
                    </category>
                
                    <category>
                        <![CDATA[ epic ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Scripting ]]>
                    </category>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 06 May 2020 20:20:55 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/04/udemy_cover_img.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Tim Grossmann</p>
<h2 id="heading-table-of-contents">Table of contents</h2>
<ol>
<li><a class="post-section-overview" href="#heading-automating-workflows-with-blueprints-c-and-python">Automating Workflows with Blueprints, C++, and Python</a></li>
<li><a class="post-section-overview" href="#heading-why-the-unreal-engine-is-interesting">Why the Unreal Engine is interesting</a><ul>
<li><a class="post-section-overview" href="#heading-why-use-blueprints-for-workflow-and-even-game-programming">Why use Blueprints for workflow and even game programming</a></li>
<li><a class="post-section-overview" href="#heading-why-use-c-for-workflow-and-game-programming">Why use C++ for workflow and game programming</a></li>
<li><a class="post-section-overview" href="#heading-why-use-python-for-workflow-optimisation">Why use Python for workflow optimisation</a></li>
</ul>
</li>
<li><a class="post-section-overview" href="#heading-writing-our-own-automated-project-clean-up-script-using-python">Writing our own automated project clean-up script using Python</a><ul>
<li><a class="post-section-overview" href="#heading-but-does-it-pay-off">But does it pay off?</a></li>
</ul>
</li>
<li><a class="post-section-overview" href="#heading-learn-how-to-automate-and-optimise-workflows-with-scripting-on-udemy">Learn how to automate and optimise workflows with scripting on Udemy</a></li>
</ol>
<h2 id="heading-automating-workflows-with-blueprints-c-and-python">Automating Workflows with Blueprints, C++, and Python</h2>
<p><strong>Every job has repetitive tasks and processes that can be automated.</strong> Those tasks can take up a significant amount of your time. </p>
<p>Someone with only basic knowledge about scripting can build a script that might cut down the time to execute those tasks to a bare minimum. In the long run, this time saving accumulates into additional hours that can be used for more productive work.</p>
<p>Learning how to automate things, therefore, is an <strong>invaluable skill</strong>. A skill that can be acquired in different, more specific sectors and then applied to other, more general ones.</p>
<p>Especially considering the current difficult times, learning a new skill that will have a significant impact on your employability is vital. </p>
<p>In this article, we want to describe the importance of automation when working with real-time software like the Unreal Engine.</p>
<h2 id="heading-why-the-unreal-engine-is-interesting">Why the Unreal Engine is interesting</h2>
<p>Epic’s Unreal Engine is one of the most popular game and real-time 3D applications out there. It's used for the creation of entertainment content like games and interactive setups.</p>
<p>Disciplines like virtual and augmented reality require the usage of sophisticated processes that, just like any other pipeline, can be optimised through automation.</p>
<p>In addition to that, the gaming and 3D real-time market is continually growing, which increases the demand for talent. </p>
<p>According to a study conducted by <a target="_blank" href="https://www.burning-glass.com/">Burning Glass Technologies</a>, a labor market analytics firm, the average salaries for Unreal developers <strong>increased by 22% last year</strong>, the <strong>wages for Artists, by 51%</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/Unreal-Engine-blog-demand-for-unreal-engine-skills-at-all-time-high-blog_body_image_salary-1600x759-0a004f058af1d5692e834705555726a8d70e7a7f.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Source: [https://www.unrealengine.com/en-US/blog/demand-for-unreal-engine-and-real-time-3d-skills-at-all-time-high](https://www.unrealengine.com/en-US/blog/demand-for-unreal-engine-and-real-time-3d-skills-at-all-time-high" rel="nofollow noopener)</em></p>
<h3 id="heading-why-use-blueprints-for-workflow-and-even-game-programming">Why use Blueprints for workflow and even game programming</h3>
<p>In addition to the general C++ programming interface, the Unreal Engine provides a <strong>graphical programming system called Blueprints</strong>. They expose the full functionality as C++ code, which means that everything, including in-game features, can be programmed without huge performance drawbacks.</p>
<p>The graphical interface allows us to quickly compose entities into a flow to create functionality. Looking at an example that sets the material for a static mesh actor, we can see that the Blueprint is easily readable.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/utility.jpeg" alt="Image" width="600" height="400" loading="lazy">
<em>Blueprints script to set a material for a static mesh actor</em></p>
<h3 id="heading-why-use-c-for-workflow-and-game-programming">Why use C++ for workflow and game programming</h3>
<p>The “native” approach to coding for the unreal engine is C++. It is used to create in-game logic, simplify level creation and workflows, and improve the development pipeline. It’s more complex and difficult to learn then Blueprints but can add an additional boost in run-time and performance.</p>
<p>Its <strong>performance advantage</strong> makes it the language of choice for essential, lower-level operations such as rendering and physics in game development. For developers that are already proficient with C++, it is a convenient addition to be able to automate processes without learning an additional language directly.</p>
<h3 id="heading-why-use-python-for-workflow-optimisation">Why use Python for workflow optimisation</h3>
<p>Compared to Blueprints or C++, Python is one of the <strong>de-facto standard languages used for automating tasks</strong>. It’s simple to learn, understandable, and extremely versatile since it can run on nearly any platform without additional effort.</p>
<p>Epic lists Python as one of the required skills, for example, for Data Pipeliners in their <strong><a target="_blank" href="https://epicgames.ent.box.com/s/n12ixy53l8cknz73npimsr54frkvm72c">Creator’s Field Guide to Emerging Careers in Interactive 3D</a>.</strong></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/Screenshot-2020-04-30-at-16.41.33.png" alt="Image" width="600" height="400" loading="lazy">
<em>https://epicgames.ent.box.com/s/n12ixy53l8cknz73npimsr54frkvm72c</em></p>
<p>The <strong>Unreal Engine has full Python scripting support</strong>. Unfortunately, it is not suitable for real-time and in-game scripting, but can only be used for Unreal Editor scripting. Python’s simplicity, however, makes it an incredible option for fast prototyping of pipeline automation.</p>
<p>Epic themselves try to promote the usage of Python using the <a target="_blank" href="https://docs.unrealengine.com/en-US/Engine/Editor/ScriptingAndAutomation/Python/index.html">documentation</a>, <a target="_blank" href="https://docs.unrealengine.com/en-US/PythonAPI/index.html">API docs</a>, and even a <a target="_blank" href="https://m.youtube.com/watch?v=0guOMTiwmhk">recorded webinar</a> about Python scripting for the Unreal Engine.</p>
<h2 id="heading-writing-our-own-automated-project-clean-up-script-using-python">Writing our own automated project clean-up script using Python</h2>
<p>Larger projects can get messy fast. Having a script at hand that can do a clean-up by looking at all of our selected assets and automatically moving them into appropriate folders helps us drastically improve our workflow.  </p>
<p>The below schematic drawing explains the idea behind the script.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/WhatsApp-Image-2020-05-01-at-14.11.07.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<blockquote>
<p>As of now, the by default version of Python set in Unreal is Python 2.7. If you want to use Python 3, you can follow the process <a target="_blank" href="https://docs.unrealengine.com/en-US/Engine/Editor/ScriptingAndAutomation/Python/index.html">described here</a> to switch to Python 3.</p>
</blockquote>
<p>To begin with, we first need to import the unreal library into our scope. Once we have done this, we can create class instances of the elementary classes. For now, we only need the <code>[EditorUtilityLibrary](https://docs.unrealengine.com/en-US/PythonAPI/class/EditorUtilityLibrary.html?highlight=editorutilitylibrary)</code> which enables us to get a list of all the selected assets. </p>
<p>We can get the number of selected assets by using Python's <code>len()</code> method and use Unreal's logging method to get output on the Debug Log in the Unreal Engine.</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> unreal

<span class="hljs-comment"># create unreal class instances</span>
editor_util = unreal.EditorUtilityLibrary()

<span class="hljs-comment"># get the selected assets</span>
selected_assets = editor_util.get_selected_assets()
num_assets = len(selected_assets)

unreal.log(num_assets)
</code></pre>
<p>The code snippet above will print a single number to the <code>Debug Log</code>. For each of the selected assets, we now want to get some information like the asset name and class.</p>
<p>The Unreal <code>[ObjectBase](https://docs.unrealengine.com/en-US/PythonAPI/class/_ObjectBase.html?highlight=objectbase#unreal._ObjectBase)</code> object has several helper methods to get the name, class, and other attributes. We will make use of the <code>get_fname()</code> and <code>get_class()</code> methods.</p>
<pre><code class="lang-python"><span class="hljs-keyword">for</span> assets <span class="hljs-keyword">in</span> selected_assets:
    <span class="hljs-comment"># get the class instance and the clear text name</span>
    asset_name = asset.get_fname()
    asset_class = asset.get_class()

    unreal.log(<span class="hljs-string">"{} - {}"</span>.format(asset_name, asset_class))
</code></pre>
<p>However, this will only give us the class definition and not the clear text name of the class itself, which we want to use for folder creation.</p>
<p>To get the display name instead of the class definition, we need to create an instance of the <code>[SystemLibrary](https://docs.unrealengine.com/en-US/PythonAPI/class/SystemLibrary.html?highlight=systemlibrary)</code>. It's <code>get_class_display_name()</code> method takes a class definition and returns the class name as <code>String</code>.</p>
<pre><code class="lang-python"><span class="hljs-comment"># create unreal class instances</span>
editor_util = unreal.EditorUtilityLibrary()
system_lib = unreal.SystemLibrary()

...

<span class="hljs-keyword">for</span> assets <span class="hljs-keyword">in</span> selected_assets:
    <span class="hljs-comment"># get the class instance and the clear text name</span>
    asset_name = asset.get_fname()
    asset_class = asset.get_class()
    class_name = system_lib.get_class_display_name(asset_class)

    unreal.log(<span class="hljs-string">"Name: {} - Class: {}"</span>.format(asset_name, class_name))
</code></pre>
<p>Now we can see something like this "Name: NewMaterial - Class: Material" printed to our log. This is precisely the kind of information we needed.</p>
<p>The last step is to "rename" our assets to a given location. For example, every Material will be renamed to <code>"/Material/&lt;Name of Material Asset&gt;"</code> which will move it into the according to folders.</p>
<p>To "rename" assets, we need an additional class. The <code>rename_loaded_asset()</code> method is part of the <a target="_blank" href="https://docs.unrealengine.com/en-US/PythonAPI/class/EditorAssetLibrary.html?highlight=editorassetlibrary"><code>EditorAssetLibrary</code></a>, so we need to create an instance of this class first. In addition to that, we have to create a new location to which the asset will be relocated.</p>
<p>To keep this more platform-independent, we will use the <code>os</code> module and its <code>path.join()</code> method.</p>
<p>Once we have created the <code>new_path</code> variable, we can use it in the method call to <code>rename_loaded_asset()</code> to relocate our current asset.</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> unreal

<span class="hljs-comment"># create unreal class instances</span>
editor_util = unreal.EditorUtilityLibrary()
system_lib = unreal.SystemLibrary()
editor_asset_lib = unreal.EditorAssetLibrary()

...

<span class="hljs-keyword">for</span> assets <span class="hljs-keyword">in</span> selected_assets:
    <span class="hljs-comment"># get the class instance and the clear text name</span>
    asset_name = asset.get_fname()
    asset_class = asset.get_class()
    class_name = system_lib.get_class_display_name(asset_class)

    <span class="hljs-comment"># assemble new path and relocate asset</span>
    new_path = os.path.join(<span class="hljs-string">"/Game"</span>, class_name, asset_name)
    editor_asset_lib.rename_loaded_asset(asset_name, new_path)

    unreal.log(<span class="hljs-string">"Moved {} to {}"</span>.format(asset_name, new_path))
</code></pre>
<p>Executing this script in the Unreal Engine, the log will provide you with such a message: <code>"Moved NewMaterial to /Game/Material/NewMaterial"</code>.<br>Observing our project, we can now see that all the selected assets have been cleaned into folders named according to their classes.</p>
<p>As you can see, creating a basic script is quite simple. Of course, we need to take care of error handling, suitable logging, and a friendly user interface for more sophisticated tools, but even simple scripts can save a lot of time.  </p>
<h2 id="heading-but-does-it-pay-off">But does it pay off?</h2>
<p>To show you how big the demand for automation in this sector is, here is a screenshot of the <strong>monthly sales of a tool</strong> with functionality containing the script we created in this article. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/04/income_tool.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Of course, it is essential to understand the needs of users and artists working in the Unreal Engine to know which tasks are suitable for automation.</p>
<h2 id="heading-learn-how-to-automate-and-optimise-workflows-with-scripting-on-udemy">Learn how to automate and optimise workflows with scripting on Udemy</h2>
<p>To help close the gap of Unreal scripting resources, we created an <strong><a target="_blank" href="https://www.udemy.com/course/becoming-an-unreal-automation-expert/?referralCode=F42ED1F45E3543848AEE">extensive Udemy on-demand course</a></strong> to learn Unreal Engine Editor scripting from scratch. </p>
<p>You can use the promo code, <a target="_blank" href="https://www.udemy.com/course/draft/2969558/?referralCode=F42ED1F45E3543848AEE"><strong>AUTOMATEUNREAL20</strong></a><strong>.</strong> You can get the course for as little as $10 now. That’s less than three Frappuccinos from Starbucks!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/05/article_udemy_promo.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If you have any questions or feedback, feel free to reach out to us on Twitter or directly in the discussion section of the course :)</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Learn Unreal Engine 4 by Coding 3 Games - A Free 5-hour Game Dev Video Course ]]>
                </title>
                <description>
                    <![CDATA[ One of the most widely used game engines is Unreal Engine by Epic Games. On the freeCodeCamp.org YouTube channel, we've published a comprehensive course on how to use Unreal Engine with C++ to develop games. In this beginner's course from Fahir Mehov... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/learn-unreal-engine-by-creating-three-games/</link>
                <guid isPermaLink="false">66b20560a5be9a107f434182</guid>
                
                    <category>
                        <![CDATA[ unreal-engine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Wed, 11 Dec 2019 20:58:45 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/09/unreal.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>One of the most widely used game engines is Unreal Engine by Epic Games. On the freeCodeCamp.org YouTube channel, we've published a comprehensive course on how to use Unreal Engine with C++ to develop games.</p>
<p>In this beginner's course from Fahir Mehovic of Awesome Tuts, you will learn how to create three full games with Unreal Engine 4 and Blueprints (a visual scripting system).</p>
<p>Unreal Engine is free to use, just like this course. This is a great way to start learning game development at no cost. Through creating these three games, you will learn many game design principles that are useful in creating all kids of games. </p>
<p>The course starts by teaching a simple game so you can learn the basic concepts. You will learn how to control a character around a 3-d environment. The character can pick up items and lose health.</p>
<p>Then you will learn to create a brick breaker game and pac-man. These games introduce more complexity such as keeping score and interacting with enemies. All the assets needed to create these games are included for free.</p>
<p>You can watch the course below or on <a target="_blank" href="https://www.youtube.com/watch?v=LsNW4FPHuZE">the freeCodeCamp.org YouTube channel</a> (5 hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/LsNW4FPHuZE" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
