Explore Free Game Artwork Tutorials – GameDev Academy https://gamedevacademy.org Tutorials on Game Development, Unity, Phaser and HTML5 Wed, 12 Apr 2023 10:01:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 https://gamedevacademy.org/wp-content/uploads/2015/09/cropped-GDA_logofinal_2015-h70-32x32.png Explore Free Game Artwork Tutorials – GameDev Academy https://gamedevacademy.org 32 32 Best Courses for Unity’s User Artist Certification https://gamedevacademy.org/best-courses-unity-user-artist-certification/ Wed, 12 Apr 2023 10:01:00 +0000 https://gamedevacademy.org/?p=21792 Read more]]> Did you know the average salary of a game artist is $69,369 per year in the USA – but can reach six figures depending on your position and skill level?

The game industry is currently booming, projected to reach $372.00bn by 2023 and grow to $545.98 bn by 2028. For those interested in game art, now is a fantastic time to break into the industry with jobs galore available. However, even with a portfolio, game art is a super competitive field without some extra edge to bring you above the competition.

This is why having Unity’s User Artist Certification can give you a boost. It proves your skills, and proves your knowledge of the game engine itself (both highly valued skills for jobs). That said, how can you prepare for the exam?

In this article, we’re going to explore some fantastic courses available to help you master the art of game art and learn Unity – even if you have zero experience with the engine.

Let’s get started!

What is the Unity User Artist Certification?

Unity’s User Artist Certification showcases your core Unity skills to help you achieve a professional role as a Unity 2D and 3D artist. It will demonstrate that you can manage aspects of art assets, scene design, and use complex tools in Unity to make character creations.

To be eligible for this exam, you’ll need at least 150 hours of Unity experience and some basic knowledge of character creation, lighting, materials, and cameras. You’ll also need to undertake two to three semesters of Unity classwork or independent study and have a portfolio containing a range of completed Unity projects before applying.

Many holders of the Unity User Artist Certification will go on to become junior developers, junior artists, lighting and technical artists, content designers, or quality assurance testers.

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

The Benefits of Unity’s User Artist Certification

Unity is the most popular game engine to date, powering half of all games worldwide. Making games using Unity will improve your chances of starting a game artist career.

Unity’s User Artist Certification is designed to showcase the professional knowledge of aspiring game artists to help them stand out against their competitors. Here are the benefits of receiving Unity’s User Artist Certification.

Boost your career chances

Having a Unity Certification will allow you to stand out in an incredibly competitive industry against hundreds of other applicants. It’s a rare credential in the game artistry industry and is used as proof that an individual has the skills needed to start a professional career. Alongside this, a Unity Certification proves dedication to being a game artist since it costs significant money and time to finish the exam.

Many Unity-based jobs list certification as a requirement, putting you in a great position to start your career in the gaming industry.

Improve your talents as an artist

You’ll need plenty of experience using Unity and C# to create game art before taking the Unity User Artist Certification, allowing you to improve your talents as a game artist. By spending at least 150 hours using Unity to create complicated characters and worlds, you’ll be more than ready to enter a professional career.

Showcase your technical skills

To obtain the Unity User Artist Certification, you need to have strong technical skills for games, apps, models, and simulations. You’ll be able to showcase your technical skills and proficiency in using Unity, one of the most popular game development programs.

What courses are best to prepare for Unity’s User Artist Certification?

To take Unity’s User Artist Certification, you need foundational knowledge of using Unity and C# for the purposes of game design. It is essential to study game artistry before applying to take the exam. Luckily, there are many online courses designed to help you improve your skills as a game designer so that you can take the Unity User Artist Certification.

Here are the best online courses you can take to prepare for Unity’s User Artist Certification.

Best Courses for Unity's User Artist Certification

Unity Game Development Mini-Degree

Passing the artist certification is as much about knowing Unity as it is about art. Zenva’s Unity Game Development Mini-Degree is a comprehensive curriculum designed around teaching you Unity from the ground up. You’ll work on everything from the foundations of Unity to building real-world projects that are perfectly suitable for bulking up any portfolio you might want to create.

Along the way, you’ll learn a ton of aspects relevant to the User Artist Certification – such as how the cameras work, how audio assets work, and even how to manage animations for your game projects (whether 2D or 3D).

Plus, all of Zenva’s courses offer tons of extra material to help with your learning process. This includes downloadable project files and text-based summaries so you can learn in whatever way suits you best!

With the Unity Game Development Mini-Degree, you’ll learn the following topics:

  • C# coding basics
  • UI systems
  • Audio effects
  • Cinematic cutscenes
  • Special effects
  • Procedural terrain
  • Animation

Skill level: Beginner. You don’t need prior experience in Unity or C#.

Duration: 36h 23m

How to access: Access the curriculum here.

Best Courses for Unity's User Artist Certification

Intro to Game Development with Unity

If you want to start off a bit smaller with your Unity journey, Intro to Game Development with Unity by Zenva is the perfect starter.

This short course is focused specifically on people who have never used Unity in their life. As such, rather than throwing to you the deep end of the pool, it takes a light, hand-holding approach. You’ll discover how to set up Unity, what windows in the engine mean, how to work in 3D space with objects, and more. Of course, you’ll also discover some fundamentals around C# as well – so when you’re ready to start building games, you’ll have the key skills you’ll need.

By the end, the course will also get you building your first interactive project!

If you’re unsure, Zenva does offer a free sample of this course via Unity 101 – Game Development Foundations.

As part of this course, you’ll cover key topics, including:

  • Installing and setting up Unity projects
  • manipulating object size, position, and rotation
  • How to change aesthetics with materials
  • Coding variables and operators with C#
  • Using various skills to create interactive games
  • Building and deploying your games

Skill level: Beginner. No prior knowledge is needed.

Duration: 2h 7m

How to access: Access the course here.

Unity Pixel Art Game Tutorial – Complete Starting Setup

2D games are still thriving, so learning how those sorts of assets work in Unity is a good skill to have as well – especially for certification.

Through Unity Pixel Art Game Tutorial – Complete Starting Setup by Restful Coder, you’ll explore how to take 2D pixel art assets and bring them into Unity for game projects. This includes how to paint tilemaps in the engine, how to import your assets properly, and even some idiosyncrasies when it comes to setting up cameras and collisions.  You’ll also learn a bit about the different ways in which creating pixel art levels through parts works.

You’ll cover key topics, including:

  • Unity overview
  • Player character and sprite
  • Player movement
  • Tilemaps and background
  • Obstacles and collisions
  • Prevent character spinning
  • Add a camera (Cinemachine) and follow player
  • Make the camera pixel perfect
  • Confine the camera to the background
  • Fix background collision bug
  • Tweak camera settings

Skill level: Novice. Some basic knowledge of Unity and C# is needed.

Duration: 51m

How to access: Access the course here.

Best Courses for Unity's User Artist Certification

Create your First 3D Game in Unity

One of the best ways to learn to work with game assets is to just build a game. Of course, you don’t want to start off too complicated, which is why Zenva’s Create Your First 3D Game in Unity is a great course.

Focusing specifically on 3D games, you’ll master a variety of platformer mechanics including how to work with character controllers, set up “enemies”, create coin collectibles, add UI systems, and more. Each element has its own asset requirements, of course, so you’ll learn a lot about how to manipulate art aesthetics using the tools Unity offers. Plus, by the end of the course, you’ll have a nifty entry for your portfolio and good skills to begin expanding into other relevant areas (such as lighting).

With this course, you’ll learn how to:

  • Create player and enemy objects
  • Construct a level with 3D models
  • Script the camera to follow the player
  • Set up the game-winning conditions
  • Add collectible coins
  • Build UI elements and menus

Skill level: Novice. You’ll need minimal knowledge of Unity and C#.

Duration: 2h 16m

How to access: Access the course here.

How to Make a Game – Unity Beginner Tutorial

In How to Make a Game – Unity Beginner Tutorial by Jason Weimann, viewers are taught the entire process of building a physics-based game using Unity. As mentioned many times before this is key to learning Unity in general, as it forces you to work with game assets in various ways.

What makes this course stand out is the fact it begins with a focus specifically on bringing and preparing your assets to actually be used in your game. So right up front, you know you’re learning about this aspect and how the basics work!

You’ll cover the following key topics:

  • Sprites
  • Importing Art
  • Animation
  • Background art
  • Physics
  • Coding
  • Dragging
  • Launching
  • Obstacles
  • Indicator
  • Camera Controller
  • Enemy
  • Particles
  • Prefabs
  • Levels

Skill level: Beginner. No prior knowledge is needed.

Duration: 3h 4m

How to access: Access the course here.

Best Courses for Unity's User Artist Certification

Create your First 2D Game in Unity

The Create Your First 2D Game in Unity course by Zenva is similar to another entry on this list. Rather than 3D assets, however, this one focuses on 2D.

Throughout the course, you’ll work through building a 2D platformer featuring collectibles, enemies, character movement, UI systems, and more. You’ll even learn how you can manage your levels so you can easily make a multiple-level game.

Along the way, of course, you’ll master a ton of tips and tricks specifically for working with basic 2D assets, which come with their own sets of rules in comparison. Nevertheless, these are essential for preparing for certification, since these differences will be important professionally as well.

This course will teach you key coding techniques, including:

  • Implementing player and enemy objects
  • Scripting platformer-style movements
  • Building levels with 2D tiles
  • Setting up collectibles and scoring
  • Controlling gameplay flow with goals
  • Creating UIs for scores and menus

Skill level: Intermediate. Some basic knowledge of Unity and C# is required.

Duration: 1h 55m

How to access: Access the course here.

How to do Character Customization!

If you’re interested in something a little more advanced at this point, look no further than How to do Character Customization! by Code Monkey! This free course shows you how to build the ever-popular feature of allowing users to have a custom character for their gameplay experience.

As you can imagine, this will cover a lot about how assets are managed, changed, and rendered – all core skills you’re going to want to master in your practice to pass the User Artist Certification!

Key topics:

  • Character Customization Unity Tutorial
  • Sponsor
  • 4 Methods to do Character Customization
  • Characters with 3 different setups
  • Change Material, Texture
  • Change Mesh, Avatar, Keep Animations
  • Add parts with SkinnedMeshRenderer
  • Issues with SkinnedMeshRenderer
  • Character Customization Unity Tutorial

Skill level: Novice. Some basic knowledge of Unity and C# is required.

Duration: 17m

How to access: Access the course here.

Unity User Artist Certification Wrap Up

This brings us to the end of our list of best courses for the User Artist Certification. We’ve covered a lot of ground here, and we just know these skills will open up new doors for you professionally and personally.

But… we’ve only been able to scratch the surface. There are thousands of courses out there, and what’s “best” may mean something different for you than it does for us. So, don’t be afraid to explore more Unity courses through platforms like Zenva – the more you learn, the better positioned you’ll be to pass the exam!

We wish you all the best of luck with the exam, and we hope we’ve made prepping for it just a little bit easier!

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Unity Tutorial – Create a Simple Fire Particle Effect https://gamedevacademy.org/fire-particle-unity-tutorial/ Tue, 11 Apr 2023 10:09:56 +0000 https://gamedevacademy.org/?p=19695 Read more]]> Have you ever thought how different your favorite games would be without effects?

Things such as sparkles shot from magic wands or fire sparks coming from a bonfire are small details that can add much more credibility to the sceneries and games we create. They are also an important aspect of “game feel” that can just, in general, improve the user’s experience with the game. So – as you can imagine – it doesn’t hurt how to learn to do them as a developer.

In this quick tutorial, we’ll show you how to make fire particles in Unity. We’ll go over the settings and adjustments needed to bring your particles alive inside this powerful game engine. Moreover, you’ll also have a glimpse of the numerous features Unity has already available for you to explore when designing your particle systems.

Let’s dive in!

Project Files

You can download a copy of the source code files for the project done in this tutorial here.

This tutorial assumes you have a few basics of Unity and, most importantly, that you have Unity installed. Also, just to be clear, we are using Unity’s default particle system, not the VFX graph. That’s a tutorial for another day. 😉

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Unity’s Particle System

First, let’s create a particle by right-clicking in the Hierarchy and selecting Effects > Particle System:

Creating a Particle System in Unity

In the small pop-up menu at the bottom of the scene, we have several configuration options at the ready:

Particle effect pop-up menu in Unity

We can pause, stop or restart the particle emission by altering the playback time of the particles, and also slow it down by changing the playback speed. By checking the ‘ShowBounds‘ checkbox we can also see how far the particles are reaching:

'Show Bounds' enabled for the particle system in Unity

This comes very in handy for us to quickly test how our particles are behaving. Nonetheless, we have a much richer range of settings for our particle system inside the Inspector:

Particle System tab in the Inspector

Each tab has a different feature you can apply to your particle. We see that the Emission and Shape ones have a little check symbol in front of them, meaning that they are currently enabled for our particle system. The Emission tab controls how many particles we emit over time, while the Shape tab indicates the sort of shape we’re emitting from (a cone, a box, a circle, etc) and sets up the angle and radius, among other properties:

Shape properties of the particle system in Unity

Another tab that’s checked in is Renderer, which allows us to customize how the particles face the camera. Right now they are set to ‘Billboard’ and if we change it to ‘Horizontal Billboard’ we’ll see the particles flat as well but facing the up direction instead:

Customizing the Renderer tab in the Inspector

We can also change the material of the particles in this tab, as well as the trail material. To add any trails to your particles, you need simply to enable the Trails tab:

Enabling Trails for the particle system in Unity

Particle System Properties

Let’s see all these properties in action! We have:

  • Start Lifetime – Dictates how long the particle exists in the world

Going back to the Particle System tab, if we bring down the Start Lifetime property from 5 seconds to 1 second we immediately see how it changes in height, as the particles are only alive for 1 second now:

Changing the Start Lifetime property of the particle to 1 second

To add a more organic feel to it, you can click on the arrow next to the value entered and select “Random Between Two Constants“. You can then enter two numbers, such as 0.5 and 1.5:

Setting the Start Lifetime property to be a 'Random between two constants'

Note how the particles don’t all disappear at the same time anymore. We can do so with the Start Speed property as well to add more variety in how fast the particles are emitted.

We also have:

  • Start Size – how large the particles are when they start out
  • Start Rotation – the rotation of the particles when being emitted
  • Start Color – the color we want the particles to be
  • Simulation Space – designates the spread of the particles in the world

If we switch Simulation Space from ‘Local’ to ‘World, we see that the particles are now being moved along with our cursor to whatever position we place it:

Setting the particle's Simulation Space property to 'World'

Other interesting tabs are Velocity over Lifetime and Color over Lifetime, where we alter the speed and color of our particles over their lifetime periods. We can use the latter to make our particles fade out as time goes by:

Making the particle fade over time in the Color over Lifetime tab

Or have multiple colors to our gradient as follows:

Adding multiple colors to the gradient of the particle in Unity

Going to the Size over Lifetime tab, it allows us to change how large the particle is over time, based on an animation curve as seen below:

Setting up the size of the particle in the Size over Lifetime tab

You can edit the curve by adding points to it and the particle will reflect the changes directly:

Editing the curve for the size of the particle in Unity

The Noise tab is also helpful to add some randomness and organic movement to our particles:

Noise tab in Unity

Remember to be careful of the Collision tab, as it adds a collider to every single particle and you may have an impact on performance by having too many of them. You can add colliders to make an explosion effect and also trigger an OnCollisionEnter function for that, for example.

Let’s put all this to use by creating our fire particle!

Fire Particle in Unity

Create a new particle system and name it “Fire Particle”. From there, let’s change how the particles look by setting the Render Mode to Mesh and the Material to Sprites-Default in the Renderer tab:

Changing the appearance of particles in Unity

In the Particle System tab, set Start Lifetime to 1 – 1.5, Start Speed to 0.2, and Gravity Modifier to -1. Also set Shape to Sphere and Shape Radius to 1 (or 0.5) in the Shape tab:

Setting up the Particle System in Unity

Next, enable the Color over Lifetime tab, and set the Color gradient to the one below:

Setting the color for our particles in Unity

Back to the Particle System tab, set the Start Size to 1 – 1.5:

Setting a Start Size for the particles in Unity

Enable the Rotation over Lifetime tab, and set the Angular Velocity to 45 – 90:

Enabling Rotation and setting up an Angular Velocity for the particle system in Unity

Also enable the Size over Lifetime tab, and set the Size curve to the one below:

Setting up the size curve for the particle system in Unity

You can bring the first point more to the left-up corner for the fire to get bigger faster as well, and then it’ll get smaller as time goes by. Feel free to tweak this as you like.

Finally, set Rate over Time to 20 in the Emission tab:

Setting the emission rate over time for the particles in Unity

If we change the background color of the camera to a solid black, we can better visualize our fire particle all set up:

Fire Particle in Unity

Notice how it’s changing color and has the fading-out effect, just as wanted!

Conclusion

Well done on concluding this tutorial!

Here you learned how to create simple fire particles in Unity in a fast and easy way! This is your first step towards designing all other sorts of particles, whether you want portal effects, magic attacks, or more. Unity allows us to customize our particles quite a lot through its default Particle System, and the more you explore it the more organic your particles will look.

We encourage you to practice with the Particle System more and try coming up with unique designs on your own! You may also want to take a look at Unity’s VFX Graph at some point as well, which takes particles to a whole new level with more power and performance – and much of the same fundamentals at play.

Regardless, good luck with your games, and we hope they “feel” that much more exciting!

Want to learn more about particles in Unity? Try our complete Intro to Particle Systems for Games course.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Introduction to Actors, Lights, & Physics in Unreal Engine https://gamedevacademy.org/unreal-engine-physics-lights-actors-tutorial/ Fri, 07 Apr 2023 05:46:32 +0000 https://gamedevacademy.org/?p=20061 Read more]]> Unreal Engine is a powerful and popular engine, and since the release of Unreal Engine 5, interest in learning to develop with it has skyrocketed.

In this Unreal Engine tutorial, we’ll take a look at three important features of the engine: actors, lights, and physics.

Actors are the very foundation of every object in our game, and so we’re going to see how to configure their properties, scale them, rotate them, and more. Following, you’ll learn how to set up the lighting environment in your scene using the various types of lights available in the engine. And lastly, we’ll cover how to apply physics to the objects in the scene and how to make them interact with each other in the game.

Let’s get started!

Project Files

You can download a copy of the source code files for the project done in this tutorial here.

Note: This tutorial was made with Unreal Engine version 5.0, so if you have a higher version you might see some elements as deprecated (although they still work).

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Creating An Actor in Unreal Engine

An Actor is an object inside of a level that can have a position in 3D space.

If you look in the Outliner panel, you can see a bunch of different Actors with different types, such as Directional Light, SkyAtmosphere, and others. Despite having different types, all of them, besides the Folder and World types, are Actors on the base level:

Actors types in Unreal Engine

Then, there is the Add button in the Main Toolbar over the Level Viewport. Clicking on it will open the menu in which you can select which type of Actor you want to create. There are Basic, Lights, Shapes, and other groups of Actors:

Creating an Actor in Unreal Engine

For this example, let’s create the Shapes > Sphere Actor:

Creating a Sphere Actor in Unreal Engine

Overview Of An Actor

You will have the Sphere object created in your level:

View of the Sphere Actor object in Unreal Engine

In the Outliner panel, you can see that the Sphere is a StaticMeshActor, just like the Floor object. The StaticMeshActoris just a 3D model that is rendered at the level. It also has the Physics and Collision components:

StaticMeshActors in Unreal Engine

With the Sphere object selected, you can go to the Details panel and change the properties of the Sphere’s components. For example, you can go to the Materials component and set the Sphere’s material to the M_Brick_Clay_New material:

Changing the material of the sphere in Unreal Engine

This will make our Sphere look like a sphere of bricks:

Sphere of bricks appearance due to change of the sphere's material

Then, in the Physics component, we can change whether our Sphere is affected by gravity by changing the Enable Gravity property’s value:

Enabling gravity for our Sphere in Unreal Engine

Next, in the Collision component, we can set how our Sphere collides with other objects. You can set whether it receives collider overlap events or if it can be stepped on, and many other things:

Collision settings for the Sphere object

Each type of Actor has its own set of components and properties to tune them to your needs. You can even create your own types of Actors, for example, for the bullet projectiles to use in an FPS game.

How Lights Work in Unreal Engine

Directional Light

Let’s open our level as it is now:

Opening our level in Unreal Engine

In the Outliner panel on the right, you should see the Lighting folder, which contains all of the actors constructing the lighting and atmosphere in the level:

Lighting and atmosphere-related Actors in Unreal Engine

In every level in which you want to have some global lighting, coming from the sun or the moon, you should use the Directional Light actor:

Directional Light is commonly used for global lighting in Unreal Engine

If you move the Directional Light actor around the level, you will notice that nothing changes — it doesn’t matter where the Directional Light is located:

Changing the location of the Directional Light actor alters nothing in the Unreal Engine's level

Altering the position of the Directional Light in Unreal Engine

But if you change the Directional Light’s Rotation, you will see that the light color and intensity change as well. The current direction of the Directional Light can be seen in the Level Viewport as the white arrow coming out of the Directional Light’s gizmo:

Rotating the Directional Light alters the color and the intensity of the light in Unreal Engine

Different light color based on the rotation of the Directional Light actor in Unreal Engine

Let’s create a cube object to see how changing the direction of the light changes the lighting:

  • Press on the Add button at the Main Toolbar
  • Select the Shapes > Cube option
  • Move this Cube to the top of the Floor

Creating a cube object in Unreal Engine

Scene view of the cube object in Unreal Engine

You can see that the Cube’s shadow is aligned with the Directional Light’s direction:

Cube shadow aligned with the Directional Light in Unreal Engine

If you set the Directional Light’s Rotation in the Details panel to value around (0, 50, 0), you will see the sky turn black. That happens because the sky color depends on the Directional Light’s Rotation:

Black sky setting with Directional Light in Unreal Engine

By changing the Y Rotation of the Directional Light you can pretty much have the day-night cycle:

Rotating the Directional Light in Unreal Engine

Rotation is not the only property of the Directional Light you can change in the Details panel. The Intensity property in the Light component allows you to control how strong your Directional Light is:

Changing the intensity of the Directional Light in the Details panel

Changing the Intensity property of the Directional Light in Unreal Engine

You can also change the color of the light with the Light Color property. For example, setting the Light Color of the Directional Light to orange will make the whole level lit with orange:

Changing the color of the Directional Light can affect the whole level in Unreal Engine

Setting the Light Color property of the Directional Light in Unreal Engine

Then there is the Light’s Temperature property, with which you can make your light hotter or colder:

Altering the light's Temperature property in Unreal Engine

If you make the (white) light colder, the whole level will look a bit “colder”:

Colder light for the level in Unreal Engine

You can also turn the shadows on and off with the Cast Shadows property:

Enabling the Cast Shadows property in Unreal Engine

Point Light

The Directional Light is not the only light we could use. If you go to the Add > Lights menu, you will see the following lights:

  • Directional Light
  • Point Light
  • Spot Light
  • Rect Light
  • Sky Light

Lights in Unreal Engine

Let’s add a new Point Light now:

Adding a Point Light to the level in Unreal Engine

The wireframe sphere around the Point Light shows the range of this light. The Point Light works like a candle — it emits light in all directions, but the farther from the source, the weaker the light. It is also can be blocked by other objects on the level:

Range of the Point Light in Unreal Engine

As for the Directional Light, the Point Light also has the Intensity and Light Color properties that can be changed in the Details panel. For example, in the screenshot below we’ve increased the Intensity of the Point Light and set the Light Color to orange:

Altering the Intensity and Light Color properties of the Point Light

Then, by changing the Attenuation Radius property you can change the range of the Point Light. The bigger this Radius, the farther the light will go:

Attenuation Radius property for the Point Light in Unreal Engine

Point Light range in Unreal Engine

Now, let’s select the Directional Light actor and disable the Light’s Affects World property in the Details panel. This way we would be able to see only the light from our Point Light actor. The regions not affected by this light would be black:

Disabling the 'Affects World' property for the Directional Light

Only the Point Light visible in the scene

Spot Light

The next light we want to try out is the Spot Light. Let’s create one by selecting the Add > Lights > Spot Light option:

Adding a Spot Light in Unreal Engine

The Spot Light works like a flashlight or a spotlight — it emits light in a certain direction and is limited by a cone-like shape:

Spot Light emitting light to a specific direction in Unreal Engine

Besides the Temperature, Intensity, Color, and Radius, the Spot Light’s Light component has two new properties:

  • Inner Cone Angle — the angle of the hard light cone
  • Outer Cone Angle — the angle of the soft light cone

Tuning those values allows you to make your light as hard or as soft as you want:

Inner and Outer Cone Angle values for the Spot Light in Unreal Engine

Here’s what the green Spot Light directed at the Cube looks like:

Green Spot Light directed at cube in Unreal Engine

Rect Light

Now, let’s add the Rect Light to our level. To do that, select the Add > Lights > Rect Light option from the Main Toolbar:

Creating a Rect Light in Unreal Engine

The Rect Light actor emits light from the rectangular shape. If you want to have a ceiling that allows the light to “pass through” or some surface to emit the light, the Rect Light is the light for you:

The Rect Light emits light from a rectangular shape

The Rect Light has the following unique properties in the Light component:

  • Source Width and Height — the size of the light source
  • Barn Door Angle and Length — allow you to focus the light

Properties of the Rect Light in Unreal Engine

If you go to the Details panel and enable the Directional Light’s ability to Affect the World, you will see that it almost overpowers all of the other lights, because of how strong it is:

Enabling the "Affect the World" option for the Directional Light

Unreal Engine’s Physics System

Unreal Engine has its own Physics system, so making the objects have physics interactions is pretty simple. First, let’s create a new Sphere object by selecting the Add > Shapes > Sphere option from the Main Toolbar:

Creating a Sphere object in Unreal Engine

You should have the Sphere object appear in your level:

Sphere object in Unreal Engine's scene

Now, let’s go to the Details panel, and in the Materials component, change the Sphere’s material. We’re using the M_Door material:

Changing the Sphere's material to "M_Door" in Unreal Engine

After that, Sphere should look like the door texture is stretched over it:

Texture applied to our Sphere in Unreal Engine

Then, in the Sphere’s Physics component, we’ll enable the Simulate Physics property. This way the Sphere object would be affected by the Physics system:

Physics component of the Sphere object in Unreal Engine

Let’s start the game now by pressing the Play button in the Main Toolbar above the Level Viewport:

Pressing the Play button in the Main Toolbar

Once the game starts, you’ll see the Sphere dropping to the floor. Also, the default camera actor in our level has physics enabled on it. So, when the game runs, you can move the Sphere by flying into it:

Physics being applied to our Sphere object in Unreal Engine

Multi-Object Physics Interactions

We can also combine those physics interactions with other objects. Let’s build a little ramp for our Sphere to run on. First, we will create a new Cube object through the Add > Shapes > Cube menu:

Adding a Cube object to the level in Unreal Engine

Then, in the Details panel we’ll configure the Cube’s Transform component like this:

  • Set the Location property to (0, 0, 70)
  • Set the Rotation property to (0, -20, 0)
  • Set the Scale property to (5, 1, 0.25)

Cube's Transform component in Unreal Engine

Next, let’s select the Sphere object, and in the Details panel, set the Transform’s Position property to (-150, 0, 270):

Setting up the Location of the Cube object in Unreal Engine

In the result, you should get the inclined rectangular ramp and the Sphere hanging over it:

Sphere hanging over an inclined ramp in Unreal Engine

If you start the game now, you should see the Sphere fall to the ramp and then roll from it to the ground:

Starting the game makes the Sphere roll down the ramp

Gravity Property

There are also other useful properties in the Physics component. For example, you can disable the Sphere’s gravity by disabling the Enable Gravity field. This way, the Sphere is still affected by physics, but not by gravity:

Enabling the Gravity property for the Sphere in Unreal Engine

If you start the game with the Sphere’s gravity disabled, the Sphere won’t fall to the ground by itself, but you would still be able to nudge the Sphere by flying into it:

Sphere does not fall down with Gravity property disabled in Unreal Engine

Let’s enable the Sphere’s gravity back now and look into other properties:

Enabling Gravity for the Sphere object in Unreal Engine

Linear and Angular Damping Properties

There are Linear and Angular Damping properties in the Physics component. They control how fast the linear and angular movement of the object is slowed down with time. By default, the Linear Damping should be 0.01 and the Angular Damping should be 0:

Linear and Angular Damping properties of the Sphere in Unreal Engine

If you start the game right now, without changing those parameters, the Sphere is going to roll until it falls from the Ground object:

Sphere relation to the Ground object in Unreal Engine

Let’s set the Angular Damping property to 5 and see how the Sphere rolls after that:

Setting up the "Angular Damping" property in Unreal Engine

When you start the game, the Sphere should stop almost right after it rolls from the ramp. That’s because now the Sphere’s Angular Damping is much higher:

Sphere now stopping right after rolling out of the ramp in Unreal Engine

Mass Property

The next property we’re interested in the Physics component is the Mass. By default, this property is disabled and the Mass is generated automatically by the engine depending on the object’s volume. For our Sphere object, the default Mass is around 109 kg:

Mass property in Unreal Engine

Now, let’s enable the Sphere’s Mass property and set it to 1, so our Sphere weighs 1 kg:

Enabling the Sphere's Mass property in Unreal Engine

If you start the game now, the Sphere will behave almost the same, but it would move further than before because it is lighter.

Conclusion

And that concludes our study of actors, lights, and physics in Unreal Engine! Well done on reaching the end of this tutorial!

With this tutorial, you’ve learned how to manipulate game objects/actors in various ways, including working with lights and physics in Unreal Engine. Foundations such as these form the core knowledge you’ll surely need to have a go at any sort of Unreal Engine game you want to build in the future!

Of course, Unreal Engine has a lot more tools to offer. We encourage you to not only explore other features of the engine, but to do further research into the aspects we covered here. There is a lot more to each – such as designing aspects for lighting or physics properties for different sorts of objects. Experiment, and maybe you’ll even generate the idea for your next Unreal Engine game!

Happy learning! (:

Want to learn more about features and tools in Unreal Engine? Try our complete Intro to Unreal Engine Game Development course.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
How to Create your First RPG UI in Godot https://gamedevacademy.org/godot-rpg-ui-tutorial/ Fri, 07 Apr 2023 05:00:35 +0000 https://gamedevacademy.org/?p=19841 Read more]]> Fact: the global RPG market is worth billions. Also fact: it’s no longer a realm for big gaming companies, but something solo and indie game developers can pursue as well.

If you’re looking to create your own games, you should definitely take into consideration making your own RPG. RPGs present you too with the opportunity to expand your coding and game design skills – as they incorporate lots of different game mechanics. However, no RPG really works without a UI, so this can’t be neglected as you develop your ideas.

In this Godot tutorial, we’re focusing on the implementation of UI elements for your RPG game. Here, we’ll be setting up a health bar together and we’ll also style a text label in order to display the amount of gold we have in the game.

Let’s dive in!

Project Files

In order to be able to follow along with this tutorial, you’ll need to download the assets found here. You can also download a copy of the source code files for the project done in the tutorial by clicking here.

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Creating the UI

Let’s start by creating the UI for our RPG game.

UI Scene

Let’s go up to Scene > New Scene:

Creating a new scene in Godot

We’re going to create a root node of ‘User Interface‘:

Select 'User Interface' for the root node

We’ll rename the node to “UI” and save the scene as “UI.tscn“:

Renaming the node to "UI"

Health Bar

Let’s right-click on our UI node and add a child node of type TextureProgress:

Adding a child node for the UI node in Godot

A TextureProgress is a bar, which can fill up a certain amount based on a given value:

TextureProgress bar in Godot

In the Inspector, we’ll drag in the image for our UI texture (UI > UI_WhiteSquare.png). into Textures > Under and Textures > Progress:

Dragging our UI texture image into the Textures' settings

We’ll also set Tint > Under to dark grey, Tint > Progress to red, and Range > Value to 50 so we can see that the progress is 50% of the way.

Enable ‘Nine Patch Stretch‘ so that the bar can be stretched to fit the size of the border:

Enabling 'Nine Patch Stretch' for the TextureProgress node in Godot

We’ll click and drag the anchor point down to the bottom left, so the health bar is snapped to the bottom left corner of the screen regardless of the screen size:

Snapping the health bar to the bottom left corner of the screen

Gold

Let’s create a new label node as a child of UI, and rename it to “GoldText”:

Creating a "GoldText" label for our UI node

Then position it above the health bar and extend it out sideways:

Positioning the GoldText node above the health bar on the screen

We’ll give it a sample text (“Gold: 500”) and align the text to the center:

Setting a sample text for our label in Godot

Sample text displaying on the screen

Custom Font

Let’s right-click on our font file (Font > Ubuntu-Regular.ttf), and click on “New Resource…“:

Adding a new font resource in Godot

… and create DynamicFont and save it as “Ubuntu-Regular.tres”:

Creating a DynamicFont in Godot

Save the new font as "Ubuntu-Regular.tres"

We’ll set the font size to 30 in the Inspector, and drag our font file (Ubuntu-Regular.ttf) into Font Data:

Setting up the new font's attributes in the Inspector

Now, let’s select the GoldText node, and assign a custom font here by dragging in the dynamic font (Ubuntu-Regular.tres) into Custom Fonts:

Assigning the dynamic custom font to the GoldText in Godot

Make sure that the anchor point of this node is also positioned at the bottom left corner of the screen:

Positionof the anchor point of the label node is at the bottom left corner of the screen

Implementing the UI

Now that our UI is all set up, let’s go back to our main scene and create a new node of type CanvasLayer:

Creating a new CanvasLayer node in Godot

Let’s drag in our UI (UI.tscn) as a child of the CanvasLayer:

Placing the UI.tscn as a child node of the CanvasLayer

UI node as a child of CanvasLayer in Godot

Our UI is now rendered on our screen:

UI rendered in Godot

UI Script

In the UI Scene, let’s go to our UI node and create a new script:

Creating a new script for our UI in Godot

Setting Up Variables

First of all, we’re going to be creating variables to get access to our UI nodes (get_node):

extends Control

onready var healthBar = get_node("HealthBar")
onready var goldText = get_node("GoldText")

Now we need to create a function for each of these variables, which will update their values.

Updating the Health Bar

Let’s update our health bar first. Note that the value of the health bar is a number between zero and 100. (0% ~ 100%):

extends Control 

onready var healthBar = get_node("HealthBar")
onready var goldText = get_node("GoldText")

# called when we take damage
func update_health_bar (curHp, maxHp):
  
  healthBar.value = (100 / maxHp) * curHp

We divided 100 by our maxHP to get the percentage value and then multiplied it by curHP to get our current health.

Updating the Text

Let’s update our gold text now. Make sure to include the text and the colon (“Gold :“) before the number:

Updating our gold text in Godot

extends Control

onready var healthBar = get_node("HealthBar")
onready var goldText = get_node("GoldText")

# called when we take damage
func update_health_bar (curHp, maxHp):
  
  healthBar.value = (100 / maxHp) * curHp


# called when our gold changes
func update_gold_text (gold):
  
  goldText.text = "Gold: " + str(gold)

Initializing The UI

Next, we need to connect this up to the actual Player node. Let’s open up our Player script:

Opening up the Player script in Godot

… and create a variable to get access to our UI node:

onready var ui = get_node("/root/MainScene/CanvasLayer/UI")

We need to initialize the UI inside of the ready() function for us to see the current values instead of the default values:

func _ready ():
  
  # initialize UI
  ui.update_health_bar(curHp, maxHp)
  ui.update_gold_text(gold)

Make sure that the UI node is placed at the top of the hierarchy as it’ll return an error otherwise. This is needed because Godot initializes and updates all their nodes from top to bottom:

Placing the CanvasLayer at the top of the hierarchy in Godot

The UI node must be placed above the Player node in order for the player script to access it.

Updating UI Elements

Finally, we have to update our UI values as we play. For that, let’s get our UI node to update the HP bar inside take_damage function:

func take_damage (damageToTake):
  
  curHp -= damageToTake
  ui.update_health_bar(curHp, maxHp)
  
  if curHp <= 0:
    die()

We also need to update the gold text inside give_gold function:

func give_gold (amount):
  
  gold += amount
  ui.update_gold_text(gold)

Now if we press play, you can see that our health starts to go down if we get attacked, and our gold goes up each time we collect a coin as expected:

UI elements updating correctly in Godot

Conclusion

Well done on completing this tutorial!

Here, you’ve learned how to implement the UI for your RPG game in Godot, something you can surely expand upon and also use in other game projects as well. This UI is also useable for any kind of subgenre you want to pursue as well – whether you want to go for an action RPG like we did or something more traditional and turn-based.

However, there’s a lot more to expand upon here even in the realm of UIs! Perhaps you want to create a second bar for mana, add a frame to your health bar, or even change the health bar’s shape entirely. There are endless possibilities even in this realm – in addition to learning tons of other core mechanics!

We hope that you have fun as you continue developing your games and wish you the best of luck in your future projects!

Want to learn more about RPGs in Godot? Try our complete Develop a 3D Action RPG with Godot 3 course.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
A Guide to Adding Bullets for FPS Godot Games https://gamedevacademy.org/godot-bullet-fps-tutorial/ Thu, 06 Apr 2023 09:59:03 +0000 https://gamedevacademy.org/?p=19756 Read more]]> The first-person shooter (FPS) genre of video games is one of the most popular among players – with huge franchises like Call of Duty, HaloApex Legends, and many others.

While FPS games have a lot of different features that could be covered, there is one mechanic that stands above the rest: shooting. Even in a versatile environment with tons of different gun types, implementing the shooting of the bullets looks pretty much the same.

With that in mind, we’ve prepared this Godot tutorial where we’re going over the entire process of creating the bullet object and setting up its properties in the game engine. We’ll also cover the scripting of the projection of the bullets out of the gun being used in the game.

If you’re ready, let’s get started!

Project Files

You can download a copy of the source code files (including the assets) for the project done in this tutorial here.

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Creating The Bullet

We’re going to start by scripting the ability for our player to shoot. For that, let’s create a new scene and save it as “Bullet.tscn”:

Creating a new scene in Godot

Here, we’re going to create the bullet prefab that we’ll be spawning at the muzzle. Create a new root node of type Area, by clicking on ‘Other Node‘ and searching for “Area”:

Creating the bullet prefab by adding an Area root node in Godot

Area is a physics node that won’t actually collide with other objects, but it can detect collisions as something goes through its collider. This is useful for bullets as they don’t need to bounce off or collide with anything, we just need it to detect when it has entered another object:

Renaming our Area node to "Bullet" in Godot

Rename this node to “Bullet”, and drag the bullet model (Models > Weapon > ammo_pistol.obj) into the scene as a child node of Bullet:

Dragging the bullet model as a child of our Bullet node in Godot

Note that the “ammo_pistol.obj” asset we’re using here can be found in the project files link above.

In the inspector, set the Transform > Translation to (0, 0, 0) to center it in the scene and set the Scale to (10, 10, 10). Lastly, set the rotation to (90, 0, 0) so it is facing forward, not upward:

Setting up the bullet model in Godot

We’ll now add another child node (CTRL+A) of type CollisionShape to the root node Bullet:

Adding a CollisionShape node to our Bullet in Godot

Set the collider shape to ‘Capsule‘ in the Inspector. Then, click on the text “Capsule” to view more options and set the radius to 0.03 and the height to 0.06:

Setting up the collider's shape, radius, and height in Godot

Adding a Timer

We need to add just one more component (CTRL+A), which is a Timer, again as a child node of Bullet:

Adding a Timer as child node of Bullet in Godot

Timer is a node that waits for a given time (1 sec by default) and then emits a signal. A signal in Godot refers to an event that a node can call out once it meets a certain condition.

In the inspector, you can choose the Node tab and see the list of signals available:

Available signals for the Timer node in Godot

Back to the Inspector panel, let’s set the wait time to 5 and enable ‘Autostart’.  This will allow the timer to automatically start as soon as the game starts:

Setting up the Timer in Godot

Next, select the root node (Bullet) and create a new script by going to Script > [empty] > New Script:

Creating a new script in Godot

First of all, we are going to create variables for the speed and damage of our bullet as follows:

extends Area

var speed : float = 30.0
var damage : int = 1

To move the bullet forward, we can multiply the global transform on the z-axis (global_transform.basis.z) by speed and apply it directly on translation within func_process(). Note that delta is multiplied here to convert it from 30 units per frame to 30 units per second:

extends Area

var speed : float = 30.0
var damage : int = 1

func _process(delta):
  
  translation += global_transform.basis.z * speed * delta

Now we need to create another function that destroys the bullet whenever the bullet either runs out of the timer or hits an object. For this, we can use queue_free() which destroys the node:

func destroy ():
  
  queue_free()

Save the script. Go back to the Timer node, open up the Node panel, and double-click on the timeout() signal. It will ask us to connect a signal to a method.

In the Receiver Method input field, type in the name of the function to call (i.e. “destroy”) and hit ‘Connect’:

Connecting the Timer node to the destroy function

Our script now has this little green mark on the left which signifies that this function is connected to a signal. This function will be called once a signal is emitted:

The destroy function is now connected to a signal

Detecting An Enemy

Following, we need to be able to detect when the bullet enters another collider. Select the root node (Bullet) and open up the Node panel.

Double-click on ‘body_entered‘ and hit ‘Connect‘:

Detecting when the bullet collides with another object in Godot

We’re going to check if the object that the bullet collided with is an enemy (by checking if the object has a method called “take_damage“), and if true, we will call the “take_damage” function and send over the damage value:

func _on_Bullet_body_entered(body):
  
  if body.has_method("take_damage"):
    body.take_damage(damage)
    destroy()

Shooting Bullets

Let us now make it so that we can shoot the bullet from the game’s weapon.

Open up the player script file (Player.gd) and create a new variable to get a reference of the bullet scene:

onready var bulletScene = load("res://Bullet.tscn")

Then we need to create a function that will be called whenever we press down on the left mouse button:

func shoot ():

In this function, we’ll create a new bullet scene node using bulletScene.instance() in a variable called “bullet”:

func shoot ():
  
  var bullet = bulletScene.instance()

Then we need to give it a parent node so it can actually exist in our main scene. We can do this by using .add_child() function:

func shoot ():
  
  var bullet = bulletScene.instance()
  get_node("/root/MainScene").add_child(bullet)

Now we need to position it and orientate it where the muzzle is at:

func shoot ():
  
  var bullet = bulletScene.instance()
  get_node("/root/MainScene").add_child(bullet)
  
  bullet.global_transform = muzzle.global_transform

We have to subtract one from our ammo as well:

func shoot ():
  
  var bullet = bulletScene.instance()
  get_node("/root/MainScene").add_child(bullet)
  
  bullet.global_transform = muzzle.global_transform
  
  ammo -= 1

Finally, we need to call the shoot function whenever we press the shoot button. We will put it inside _process() as we need to check if the shoot button is pressed every frame. Also, ensure that the ammo is greater than 0:

func _process(delta):
  
  # check to see if we have shot
  if Input.is_action_just_pressed("shoot") and ammo > 0:
    shoot()

Note that the muzzle node should be facing the correct direction. If it’s facing the wrong direction, rotate it 180 degrees on the y-axis:

Rotate the muzzle node if facing the wrong way

Save and hit Play. We’re now able to shoot bullets from our gun:

Shooting bullets from our gun in Godot

Conclusion

Well done on completing this tutorial!

For those looking to build their own FPS, this is a huge step already! You can now shoot bullets from any weapon of your choice in your Godot game – with systems that make customizing your bullet assets easy!

FPS games make great projects for beginners and experience developers alike – but there’s more to do. Expanding your project further, you can design the game environment and the player’s choice of weapons as you see fit, apart from being able to add interactable pickup items and coding the enemy AI as you’d like. There are many more directions to go, but with the core shooting mechanics done you’re on the path to success!

We wish you the best of luck in your game development journey!

Want to learn more about FPS games in Godot? Try our complete Build a First-Person Shooter with Godot 3 course.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
How to Create Your First Player Character in Godot https://gamedevacademy.org/player-character-godot-tutorial/ Thu, 06 Apr 2023 09:14:51 +0000 https://gamedevacademy.org/?p=19693 Read more]]> Every game has its unique, core mechanics, but one thing they all share in common is the player character.

Whether first-person or third-person, designing the movement and behavior of the player is one of the first processes that we need to go through when creating games. This is important as it’s what characterizes how the players are expected to interact with the objects and obstacles of the game. Thus, knowing how to create players is a core skill for game development that cannot be skipped!

In this tutorial, we’ll cover the creation of a player character in Godot from the start – ranging from how to create the player node and add it to the game scene to how to configure the player’s sprite and set up the properties of its collider component.

All that said, let’s dive in!

Project Files

You can download a copy of the final source code files for the project done in this tutorial here.

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Creating the Player Sprite

Importing assets

After having created a new project in Godot, you first have to download the project assets available here to your computer.

Next, select and right-click the root folder in FileSystem, then go to ‘Open in File Manager‘:

Right-click on the root folder of the project in Godot and go to Open in File Manager option

This will open up a window with the files of our project. Now, with another window open with the assets you’ve downloaded from the link above, drag and drop the Sprites folder into the project folder:

Drag and drop the assets into the project folder

Or simply copy and paste them over so that they appear amongst the files of our project:

Importing assets to our project in Godot

Creating a Node to be our Player

To create our player, let’s click on ‘Scene’ and then ‘New Scene‘:

Click on Scene then 'New scene' to create our player in Godot

Select the ‘Other Node‘ option and search for “KinematicBody2D” in the ‘Create New Node’ window:

Search for KinematicBody2D when creating a new scene in Godot

Choose the ‘KinematicBody2D’ node and hit ‘Create’. The new node is now visible in the Scene window. Rename it to ‘Player‘ by double-clicking on it:

Rename the scene to Player

Adding a Sprite to the Player Node

Following, double-click the Sprites folder in the FileSystem to open it. Select the ‘Player_Idle‘ file and drag it into the viewport:

Drag the Player_Idle image to the viewport in Godot

This creates a new node as a child of the Player node:

Player_Idle is now a child node of the Player scene

In the inspector, go to Transform then click on ‘Position’. Set both x and y to 0:

Setting the position of the sprite to be the origin

The sprite is now centered in the origin (0, 0). Hit Ctrl+S to save the scene:

Sprite in origin position in Godot

Let’s also rename the sprite from ‘Player_Idle’ to ‘Sprite‘.

Adding a Collider to our Player

You’ll note that we’re having a node configuration warning next to our Player scene icon. It says that we need to add a collision child to define the shape of our KinematicBody node. To do that, right-click on the Player, and go ‘Add Child Node‘:

Adding a child node to our Player scene in Godot

Double-click on ‘CollisionShape2D‘ to create it:

Double-click on CollisionShape2D to create a new collision node

Go to Inspector and click on the arrow next to ‘Shape‘. Then select ‘New RectangleShape2D‘ as follows:

Setting up the collider node in Godot

To change the size of the collider, drag the red dots around to adjust the size so that it aligns with the whole sprite:

Adjusting the size of the collider shape in GodotCollider shape correctly adjusted to include the whole sprite size in Godot

Bringing the Player to the MainScene

At last, click on ‘MainScene‘. Go to FileSystem and drag the ‘Player.tscn‘ into the main scene:

Drag the Player.tscn into the main scene in Godot

Save the scene and click on the ‘Play‘ button:

Click on Play to run our scene in Godot

You’ll see that our player shows up in the game window:

Running our player scene in Godot

Scripting our Player in Godot

Let us now start scripting our player sprite.

Go to Project then click on ‘Project Settings…‘, and go over to the Input Map tab:

Project settings menu in Godot

Creating New Actions

We can create new actions for our sprite by adding in some new keys.

Write ‘move_left‘, ‘move_right‘ and ‘jump‘ then click on ‘Add‘ after each addition to include them to the list:

Adding action keys in Godot

We now need to assign each action a unique key. Simply click on the ‘+‘ button next to each action and press the relevant key on your keyboard:

Assigning a key to the added actions in Godot

In this tutorial, we’re going to use the left and right keys to move to the left and to the right, and the up key to jump. After confirming your choices, you can close the project settings window.

With the Player node selected, go to the Script tab in the Inspector panel. Expand it and click on ‘[empty]’. Then select ‘New Script‘ in the dropdown:

Creating a new script for our Player node in Godot

Hit the ‘Create‘ button:

Creating a new script in Godot

This will automatically open up a Scripting Interface as follows:

Script interface in Godot

Declaring Variables

A variable is basically a container that can hold data. The value may change depending on conditions or on commands passed to the program. To create our first variable, type ‘var‘ and then enter a variable name. After that, we can give it an initial value of zero by entering ‘ = 0‘:

extends KinematicBody2D

var score = 0

So now the score variable has a data type of int. You can also add a type hint with a colon (:) after the name to keep it as an integer, which is a whole number:

extends KinematicBody2D

var score : int = 0

You can also set a different data type, such as Vector2 or Sprite. Vector2 holds two numeric values that represent the x, and y coordinates of a point:

extends KinematicBody2D

var score : int = 0

var speed : int = 200
var jumpForce : int = 600
var gravity : int = 800

var vel : Vector2 = Vector2()

var sprite : Sprite = $Sprite

Note that the dollar sign ($) operator is used in front of Sprite. This basically tells the script to look through all of the children nodes and find the node of whatever type is defined after the $, which is Sprite in this case.

The alternate syntax to the dollar sign ($) operator is to use the get_node function. Simply replace $Sprite with get_node(“Sprite”):

var sprite : Sprite = get_node("Sprite")

We can also add a keyword called ‘onready‘ before ‘var’ to make sure the asset is ready when the scene loads:

onready var sprite : Sprite = get_node("Sprite")

This delays the initialization of the variable until the node of Sprite is found.

Moving the Player

Next, we will implement the ability for the player to move around and jump. First, we need to apply gravity. This is going to be done inside of a function called _physics_process():

func _physics_process(delta):

This is a built-in function of Godot, which gets called 60 times a second to process physics. First, we want to set out velocity on the x value to 0 as follows:

func _physics_process(delta):

  vel.x = 0

Then we will check our movement inputs, that is, if the Input system detects ‘move_left’ action:

func _physics_process(delta):

  vel.x = 0

  #movement inputs
  if Input.is_action_pressed("move_left"):

Our velocity on the x should be equal to negative ‘speed’ when we press the “move_left” button, and positive ‘speed’ when we press “move_right”:

func _physics_process(delta):

  vel.x = 0

  #movement inputs
  if Input.is_action_pressed("move_left"):
     vel.x -= speed
  if Input.is_action_pressed("move_right"):
     vel.x += speed

When moving a KinematicBody2D, you should not set its position property directly. Rather you should use the move_and_collide() or move_and_slide() methods. (*Note that these methods should be used within the _physics_process() callback.)

The move_and_slide() method moves the body along a given vector, and if the body collides with another, it will slide along the other body. This is especially useful in platformers or top-down games.

To use the move_and_slide(), we need first to send over the velocity and the direction in which the floor is pointing. Since the ground will be below us, this would be Vector2.Up:

func _physics_process(delta):

  vel.x = 0

  #movement inputs
  if Input.is_action_pressed("move_left"):
     vel.x -= speed
  if Input.is_action_pressed("move_right"):
     vel.x += speed

  #applying the velocity
  move_and_slide(vel, Vector2.UP)

Flipping the Sprite

Now, we can assign it to our velocity and check which direction our player sprite should be facing:

func _physics_process(delta):

  vel.x = 0

  #movement inputs
  if Input.is_action_pressed("move_left"):
     vel.x -= speed
  if Input.is_action_pressed("move_right"):
     vel.x += speed

  #applying the velocity
  vel = move_and_slide(vel, Vector2.UP)

  #sprite direction
  if vel.x < 0:
     sprite.flip_h = true
  elif vel.x > 0:
     sprite.flip_h = false

Save the script and press Play:

Moving the sprite to the right in GodotMoving the sprite to the left in Godot

You can now move the Player horizontally with arrow keys. The sprite will flip as the moving direction changes.

Applying Gravity

To implement gravity is pretty straightforward, we can simply add it directly onto our y velocity:

func _physics_process(delta):

  vel.x = 0

  #movement inputs
  if Input.is_action_pressed("move_left"):
     vel.x -= speed
  if Input.is_action_pressed("move_right"):
     vel.x += speed

  #applying the velocity
  vel = move_and_slide(vel, Vector2.UP)

  #gravity
  vel.y += gravity * delta

  #sprite direction
  if vel.x < 0:
     sprite.flip_h = true
  elif vel.x > 0:
     sprite.flip_h = false

When you add/subtract from the velocity, it needs to be multiplied by delta so that it accelerates at the correct speed:

#gravity

vel.y += gravity * delta

Jump Input

We need to check if the ‘jump’ key is detected, and we also need to check if the player is on the floor:

#jump input
if Input.is_action_just_pressed("jump") and is_on_floor():

We then want to apply the jump force in the opposite direction of gravity:

#jump input
if Input.is_action_just_pressed("jump") and is_on_floor():
  vel.y -= jumpForce

Make sure you have saved the script:

extends KinematicBody2D 
 
var score : int = 0 
 
var speed : int = 200 
var jumpForce : int = 600 
var gravity : int = 800 
 
var vel : Vector2 = Vector2()
 
onready var sprite : Sprite = get_node("Sprite")

func _physics_process(delta):
  
  vel.x = 0
  
  #movement inputs
  if Input.is_action_pressed("move_left"):
    vel.x -= speed
  if Input.is_action_pressed("move_right"):
    vel.x += speed
  
  #applying the velocity
  vel = move_and_slide(vel, Vector2.UP)
  
  #gravity
  vel.y += gravity * delta
  
  #jump input
  if Input.is_action_just_pressed("jump") and is_on_floor():
    vel.y -= jumpForce
    
  #sprite direction
  if vel.x < 0:
    sprite.flip_h = true
  elif vel.x > 0:
    sprite.flip_h = false

* Note that if you press the play button now, the character will simply fall. That happens because there’s no ground for the player to interact with, as we’re not implementing it in this tutorial. You can think of this as a challenge for yourself!

Conclusion

Well done on completing this tutorial on how to create a player with Godot!

Although there’s much to expand here, you’ve already learned how to script your player in Godot and how to set up the player’s sprite and kinematic properties so it behaves as desired! You can now move on to coming up with your game’s level style and structure, besides some enemy logic or coin collection to make your game exciting.

Godot is also a great choice for beginners – as its node-based user interface makes it easy to create games while also facilitating access and project organization. Plus, the engine is open source and has a strong community backing the project, so there are constant updates and new features being released all the time.

We wish you all the best of luck with your game projects, and that you continue learning more each day!

Further Resources

Would you like to see more on Godot? Check out our recommendations to help you on your journey below:

Want to learn more about developing in Godot? Try our complete Godot 3 Game Development for Beginners course.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
The Best Godot 4 Tutorials – Complete Game Dev Guide https://gamedevacademy.org/godot-4-0-tutorial/ Wed, 05 Apr 2023 05:29:37 +0000 https://gamedevacademy.org/?p=12194 Read more]]> Godot 4 is the newest major update for the Godot game engine. In January 2018, Godot 3.0 was released which introduced many new features such as a new rendering engine and improved asset pipelines. With the official release of Godot 4 in 2023, similar major advancements have come about that are sure to improve game development for users!

In this article, we’ll discuss some of the newest features for Godot 4 – and then show you where you can start learning!

Let’s dive in!

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

Vulkan Rendering Engine

One of the major features for Godot 4 is the Vulkan rendering engine. It was introduced to the master branch of the engine back in February 2020, although OpenGL ES 3.0 is still supported. Godot 4 features full implementation of the Vulkan engine. So why make the change? Godot 3 is using OpenGL – which is supported on many platforms. But, as tech is moving forward, compatibility becomes much less of an issue using the Vulkain engine. Vulkan is also much more “lower-level” than OpenGL, allowing it to perform better and faster.

Core Engine Improvements

Godot 4 also features some major updates to the core of the engine. With an update like this, it’s given the developers an opportunity to make these much-needed changes. Here’s a few things that were changed:

  • Support for multiple windows
  • General cleanup of the API
  • Renaming of nodes and servers

Godot multiple windows.

New Lightmapper

Godot’s new lightmapper for 4 is so much of an improvement, that the devs are going to back-port it to Godot 3 as well. Lightmapping is pre-calculating the light for a game scene. This provides the benefit of having realistic lighting at a low computational cost. Here’s how the new lightmapper improves upon the older one while also making the experience easier for you as a developer.

  • GPU based – allowing for faster bake times
  • Easy to use – minimal number of parameters
  • Lightprobes
  • Automatic UV unwrapping

Other Improvement

While the three mentioned above are our favorite improvements, there have been a lot of other features and improvements added to the platform. These include:

  • Improved 2D tools and rendering
  • Shader and visual effects enhancements
  • Tweaks to both GDScript and C# for Godot
  • Overhauled physics
  • Stabilized networking for multiplayer games
  • Better animation tools and performance

Godot’s video below will help summarize everything with the release for your convenience as well (if you want to hear it from the horse’s own mouth, so to speak.

Summary of Godot 4’s Release

To sum it all up, the aim of Godot 4 is not necessarily to introduce a large number of new features, but to improve upon the rendering and engine performance in order to bring it up to the same level as other game engines out there.

However, the importance of a performant engine cannot be overstated – and puts Godot well in the arena to compete with engines such as Unity and Unreal Engine. Regardless, we hope this has excited you for this new release. Now is a fantastic time to learn a new tool if you’re in the market for one, or to re-familiarize yourself with Godot if you thought you knew everything about the engine already!

Without further ado, below we’ve put out our favorite tutorials for Godot 4 (along with some extra resources to speed up your learning process! Good luck, and we can’t wait to see your future Godot game projects!

Best Tutorials and Resources for Godot 4

Important Links

Demos & Key News

Premium Godot Tutorials

General Tutorials

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
How to Set up Environments with QUIXEL in Unreal Engine https://gamedevacademy.org/unreal-quixel-tutorial/ Fri, 31 Mar 2023 01:00:34 +0000 https://gamedevacademy.org/?p=21708 Read more]]>

You can access the full course here: MAKE A PLANE ARCADE GAME IN UNREAL ENGINE

Environment – Part 1

In this lesson, we will learn how to set up our environment to create a more visually appealing game. By using Quixel Bridge, we can easily download high-quality photo-scanned assets for free. Quixel is basically a library of many different photo-scanned, 3D models that can be used for free within Unreal Engine.

Using Quixel Bridge

To get started with Quixel Bridge, go to Window and then Quixel Bridge. You can also undock the window for ease of use.

Quixel Bridge

Next press the Planet symbol and choose Environment.

Planet symbol and Environment

From here, Scroll Down and choose the Natural environment option.

Natural environment

This will give you many different environments to choose from, feel free to pick any environment you like, however in this course we will be using the Artic Ice And Snow environment collection.

Artic Ice And Snow

Now you can select an asset you like and click and drag it into your level, this will download and spawn the object in your level. It may prompt you to sign in before downloading in the bottom right.

asset

You can then move, rotate and scale your 3D model as you see fit within the level to build your scene.

You can also click and drag materials onto objects in your scene, to try this, select a ground material from Quixel Bridge and drag it onto our ground cube in the level.

materials

Now you can bring in any 3D models, materials, and props you like from Quixel Bridge to make your environment. Also, duplicate the rings we created previously to set up a course for your plane to fly through!

Environment – Part 2

In our example level we created a small, inclosed environment using the Quixel Bridge assets and made a large path of rings through out it for the player to fly through.

inclosed environment

Testing

We’re now ready to press Play to test out the game.

Testing

You should now be able to control your plane, fly through all of the rings and complete the course while increasing your score. You are now all set for creating your own arcade plane game, you could expand upon this in multiple ways such as adding weapons to shoot at targets with, a race objective around an obstacle course or adding collisions to the walls.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

Transcript – Environment – Part 1

Welcome back, everyone. In this lesson we are gonna be working on setting up our environment.

Now, right now you can see we have a pretty bland environment right here with just the rings, the floor, and the default sky.

So what we’re gonna do is we are gonna go ahead and use Quixel Bridge in order to get some high quality photo scanned assets into our game here. So to do this, we’re gonna go up to Window, we’re gonna go over to the Quixel Bridge.

Now, Quixel is basically a library of hundreds and thousands of different photo scanned 3D models. So these are high quality models that we can just drag and drop into our project for free, okay?

So in the bridge here, what we’re gonna do is I’m just gonna undock this window because we do sort of want it in the same view as our level here. And what we’re gonna do is we are just going to search for what we want.

So on the left hand side here, you’ll see there is a little planet. And I’m gonna hover over that, I’m gonna click on it, I mean, click on environment, and then environment here, we’re gonna go down click on natural.

And as you can see, there are plenty of different environments we can choose from. I’m gonna go Arctic Ice and Snow, just ’cause I think that’ll be pretty cool for a plane game.

And yet we can then go through, click on an asset that we might like, and you may have a option down here to log in before you actually download these.

And make sure you do that. Just log in with your Google account, with your Epic Games account. There’s plenty of ways to log in.

So once you do that, what we can do is we’re not gonna click on download because that will download it to our computer and makes it a bit hard to find.

Instead, what we’re gonna do is we are gonna click and drag on the thing that we want, and we’re gonna click and drag it into our level here. And then you’ll see that it spawns in like so, okay?

We can then scale it up, move it around, rotate it, and this basically just acts as a 3D model. And depending on which quality you set here, it depends on of course the size of the textures and the size of the model.

But overall, these models do look pretty good. And something else we can do is then, on our ground, we can click and drag on this material to apply it like so. And there we go.

We have that snow texture now applied to our ground. What I want you to do now is just go through and drag in the 3D models that you wish to create and set up your environment.

Okay, there are plenty of different models and environment set pieces here. So set those up. And also go ahead and start duplicating these rings and positioning them in places where, you know, you might have a nice challenging flight game to play. So I’ll be right back to see how you’re doing.

Transcript – Environment – Part 2

Okay, so you to go at that challenge. Pretty much just start placing those models around. As you can see, I also put these rings around, so the players to fly through them.

And you also got some other ground assets here to just add to the environment. So we can press play and test it out. Okay, increase our flight speed. Make it over to the ring little course I made over here. And there we go.

So as you can see, you can pretty much create whatever sort of flight arcade game you want. You might even wanna start adding in some weapons to the planes if you want.

You might add some targets that you could shoot down. Really, there’s a lot of things you can do with this little plane blueprint right here. You can of course, create rings like we’ve done. You can create weapons, create targets.

You might even wanna create a race around an obstacle course with collisions on the walls, so that if you were to bounce into them, the plane would explode. And yeah, that is our plane game inside of Unreal Engine.

Thank you for watching.

Interested in continuing?  Check out our all-access plan which includes 250+ courses, guided curriculums, new courses monthly, access to expert course mentors, and more!

]]>
Best Unity Audio Tutorials – A Guide to SFX and Music https://gamedevacademy.org/best-unity-audio-tutorials/ Mon, 23 Jan 2023 08:06:44 +0000 https://gamedevacademy.org/?p=15383 Read more]]> When was the last time you played a game that was completely silent by design?

From ambient background music, UI SFX, or even the sound of footfalls, sound plays an important role in game development. Sounds not only increase the atmosphere of the general game experience, but can also add necessary feedback to player interaction with the game mechanics. Some games have even made sounds a core component of the gameplay. So, all around, while we could technically play games without sound, they can be equally important depending on the sort of game you want to make.

This article will explore this topic and feature the best Unity audio tutorials available. These tutorials will be aimed at getting you up and running with audio in Unity, both in terms of engine available tools and C# scripting. We’ll also explore some less obvious features that you might find helpful with adding some extra “oomph” to your game project.

Let’s dive in, and learn about audio!

Game Audio Effects for Beginners

Duration: 1 hour, 30 minutes

Starting with a premium resource, this course by Zenva is the total package when it comes to audio, as it covers a little bit of everything.

Of course, the tutorial starts of easy showing you how to add and play audio within the Unity engine – whether via component or script. As you explore these concepts, though, you’ll also learn how to perform certain different audio effects. This includes having specific areas for background music, adding SFX, or even doing something as complicated as the doppler effect.

As a bonus, the course also shows you how to make a simple volume control menu. This includes both splitting sounds into different channels, and making a UI. So, if you want to learn a little bit of everything at once, this is a fantastic place to start.

LEARN NOW

Introduction to AUDIO in Unity

Duration: 14 minutes

For developers who have never touched audio as part of Unity, this tutorial by Brackeys is a great starting point.

The tutorial goes over the basics of really just playing audio. However, it does this in a few interesting ways. To start, it covers some of the settings available in the audio components, particularly looping music so you can get a background music effect. It also covers a lot of scripting, from just playing sounds from a C# script, to setting up an audio manager to control when and how sounds are played (though in a beginner-friendly way).

As a bonus, the video also covers the concept of how to handle sounds when switching scenes, which is perfect for dealing with background music for any game.

LEARN NOW

How to add background audio & on-click SFX

Duration: 13 minutes

Aren’t keen on C# coding yet? Well, this tutorial by Erika Verkaaik will help you skip that.

Focusing on Unity’s audio-related components, this tutorial will show you how to set up a scene with background music and SFX for a fire that can be triggered on or off with a simple button. As stated, none of this will require you to code at all, and relies solely on built-in tools offered by Unity. Thus, if you want something quick and dirty, this tutorial will show you how.

In light of that, though, we do want to mention this tutorial is also good for exploring the concept of audio sources in 3D space. This will be very important as you develop more kinds of games, and is also a good bonus to pick up here.

LEARN NOW

Learn UNITY AUDIO (The Ultimate Beginner GUIDE)

Duration: 25 minutes

This tutorial by SpeedTutor is another great beginner’s level tutorial for those just getting started with audio in Unity.

Of course, it covers all the basics you would expect: how to handle Unity’s audio components, how to play audio from a script with triggers, dealing with audio sources in a scene, and even playing around a bit with the audio mixers Unity offers.

Where this tutorial really stands out is its practical approach. Rather than using a menu or featureless level for testing audio, you’ll see everything showcased with a scene that looks completely polished for a finished game. Thus, you’ll learn both how to work with your audio and a bit about the practical design implications for using it in actual game projects.

LEARN NOW

Simple Sound Manager

Duration: 19 minutes

In this tutorial by Code Monkey, you’ll learn some robust C# scripting skills for making a sound manager capable of handling all your in-game SFX.

While there are many different ways for handling audio in Unity, in some cases you may want a static manager to handle every instance you need to play a sound – no matter what that sound is. This can be very efficient in many cases, especially if you later want to add things like volume controls that effect all your sounds at once.

This tutorial will show you how to do just that so you can add sounds like footsteps, sword slashes, UI interaction, and more as players interact through their character. This, of course, will be played with a single sound manager, making sure that no matter what your character does, the appropriate SFX always plays.

LEARN NOW

Manage your sound in Unity – Tutorial

Duration: 9 minutes

Giving players agency to control the audio’s volume is a key setting expected in most polished games, and this tutorial by Tarodev will help you set that up.

The focus of this tutorial is building a menu that can theoretically be accessed from anywhere in the game. This menu will contain UI elements that allow players to mute the background music, mute the effects, or change the volume of the sounds in general.

Of course, as part of building this menu, you’ll learn how to access the necessary Unity audio tools that allow you to adjust these settings. You’ll also build this sound manager in a way that, as implied above, allows you to effect all sounds in your game. This means it will work across multiple scenes, so you don’t have to fear having many levels as part of your game’s design.

LEARN NOW

Separate Volumes for Music & Sound Effects!

Duration: 13 minutes

What if you want a volume controller like the tutorial above, but want to do things like separate the volumes for music and SFX?

This tutorial by Ricky Dev covers – as stripped down as possible – creating both a menu and sound manager setup that splits audio for music and SFX. The effect is achieved by learning how to use the audio mixers and assigning your sounds to specific audio groups. These groups then allow you to control the volume for specific sets of sounds, allowing you to create dynamic volume controls.

To boot, this tutorial also makes this process very modular. So, for example, if you also had character voice over and wanted to split that into its own group, this setup makes that very easy to do!

LEARN NOW

AUDIO MIXERS In Unity

Duration: 17 minutes

If you’re looking for something a bit slower paced when it comes to setting up volume control menus, this tutorial by Kap Koder is a good one to check.

Like others on this list, this tutorial covers everything you need to set up a volume control menu where the music and SFX are separately controlled. This includes separating things with the Audio Mixer, setting up the UI sliders, persisting the audio settings between scenes, and so forth.

However, this tutorial does take a bit more time to explain things as the menu is developed – particularly with some of the C# coding elements and why certain choices are made. Thus, if you’re a bit less experienced, this slower pace may be the better match for this particular aspect of Unity audio.

LEARN NOW

How to Fade Between Audio Tracks

Duration: 12 minutes

For those who want to create a smoother audio experience, this tutorial by Comp-3 Interactive will teach you the coveted fade-in, fade-out effect.

Particularly when you have ambient sounds or background music, there may come a time when you need to switch the tracks you’re using (as exampled in this tutorial, walking outside from inside). With fade-in and fade-out tricks, you can make sure this switch isn’t jarring, and helps maintain the ambient atmosphere that you may want for your game.

Using primarily C# scripting, this tutorial will show you how to combine volume, loops, and coroutines that allow you to create this fading audio effect. This will be set up to work with any sort of audio as well, so can be applied to many different cases.

LEARN NOW

How to Seamlessly playing music between multiple scenes

Duration: 9 minutes

In this tutorial by CatoDevs – Unity & R Tutorials, you’ll learn how to carry music over from scene to scene.

Scenes in Unity can be fairly isolated from each other. In general, they’re designed to refresh the entire collection of objects available and be almost like a fresh game. While this is perfectly fine in a lot of cases, it can be a pain for audio. After all, what do you do if your scenes need to have a continuous music track?

This short tutorial helps overcome this problem by showing you how to set up a singleton for your audio with the express purpose of bringing music from one scene to the next. Not only does this work in a way that the track doesn’t restart, but you can maintain a consistent volume with a matching UI.

LEARN NOW

Audio Track | Getting Started with Timeline

Duration: 6 minutes

A unique entry on this list, this tutorial by Omar Balfaqih will show you how audio works with the Unity Timeline.

When it comes to composing animations, particularly cutscenes, the Unity Timeline is the go to tool. This tool lets you add various animations, sounds, and cameras to a track. Via this track, you can then arrange these elements to compose your cutscene, choosing the appropriate timings for everything to play.

Using a prebuilt, animated scene as an example, this tutorial will show you specifically how to work with audio. This includes how to adjust placement on the Timeline, how to edit the audio to fit what you need, and even how to deal with your audio sources as it relates to this specific game development task.

LEARN NOW

Unity Audio Tips: Sends, Receives and Effects

Duration: 13 minutes

In this tutorial by Thousand Ant, you can learn to unlock the full power of the Unity Audio Mixer.

Previous entries on this list have focused more so on using the Audio Mixer for volume control. However, the Audio Mixer can also be used as a powerful tool to mix the audio in general for different effects – which can lead to some amazing game atmosphere.

The tutorial in particular shows you how by setting up different groups, and using send and receive signals, you can change the default sound your audio plays. This includes adding things like reverbs, delays, and so forth, all of which can change the game feel of your project. The tutorial also briefly covers how to script a simple random music player, giving you another fantastic tool to add to your audio arsenal.

LEARN NOW

Parting Words

This brings us to the end of our list of best Unity audio tutorials! While adding sound is simple enough, there are a lot of aspects to consider. There are tons of audio effects you’re able to achieve, loads of ways to handle your audio, and even performance considerations to contend with. However, with the tools we’ve presented, we hope we’ve given you a good basis from which to explore adding audio to your game projects.

That being said, we encourage you to dive into even more topics, as audio is as creative as it is technical when it comes to game development. You may also want to learn about topics related to sound design and how these affect your game feel. Regardless, though, we wish you the best of luck, and we can’t wait to “hear” what games you come up with.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>
Best Unity Lighting Tutorials – Light up Your Game Levels https://gamedevacademy.org/best-unity-lighting-tutorials/ Mon, 23 Jan 2023 08:06:29 +0000 https://gamedevacademy.org/?p=15380 Read more]]> Lighting is an often overlooked aspect of a game’s look.

Whether a sunny day, quiet night, or dark dungeon, lighting plays a big role in aesthetics. It determines not only what players are seeing, but can add a layer of atmosphere to create a specific mood. After all, would a horror game that has no darkness or sparse lighting be as scary as one with those elements?

Through this article, we wish to explore the topic of lighting, and set you up with the best Unity lighting tutorials available. These tutorials will not only get you familiar with how Unity’s lighting system works, but show you how you can use it for very specific effects.

If you’re ready to light up your worlds, let’s get started.

BUILD YOUR OWN GAMES

Get 250+ coding courses for

$1

AVAILABLE FOR A LIMITED TIME ONLY

UNITY LIGHTING 2020 TUTORIAL For Beginners – Tips, Basics and Settings

Duration: 36 minutes

If you’ve never working with lighting in Unity before, this tutorial by TheUnityGameDev is a great place to start.

The tutorial covers a little bit of everything you might need to know about lighting fundamentals. This includes how to set up your basic lights and adjust them, and how to understand differences between direct and indirect lighting.

In addition to this, though, the tutorial also extensively covers the various light settings available in Unity. You’ll, of course, learn many of the foundations you’ll need for any setup, including settings for the global illumination. However, you’ll also dive into other concepts like baked vs realtime lighting, mixing lighting, and how these concepts can affect your final game’s performance.

LEARN NOW

LIGHTING in Unity

Duration: 16 minutes

For beginners who want to dive more into baked lighting, this tutorial by Brackeys will help you get started.

This tutorial is broken a up into two halves. The first half covers a lot of lighting fundamental theories on how it works. You’ll discover how global illumination plays a role in lighting, how lighting bounces around, how baking works, and so forth – all concepts needed regardless of the lighting you’re using.

The second half of the tutorial covers using the Progressive Lightmapper to light up a scene with different colored lights hitting the same object. This particular tool uses path tracing to more realistically determine how light would bounce around and how that would appear to your camera. You’ll not only learn how to use the Progressive Lightmapper, but also discover many of the settings you can adjust to get the look you want – all with near realtime updates in the editor.

LEARN NOW

3D LIGHTS and LIGHTMAPPING EXPLAINED in Unity 2021

Duration: 14 minutes

Need your baked lighting done quickly? This tutorial by Spectra is right up your alley then.

Like the tutorial above this one, this tutorial covers all the basics of setting up baked light with a lightmap. Whereas the other one focused more so on theory of how light works, this one skips over a lot of that. Instead, it takes a very practical step-by-step approach so you can focus primarily on getting your light set up and various settings that will help improve it as quickly as possible.

To add to this, the tutorial also dives a bit into the justification for lighting and its role in level design. Thus, if you are interested in some theory but as it practically applies to game development, this tutorial is definitely for you.

LEARN NOW

Mastering Unity Lighting Settings & Performance

Duration: 13 minutes

This tutorial by Game Dev Republic does exactly as the title suggests: explains settings available for Unity lighting.

Though knowing how to place and face your lighting in your scene is important, the light settings are where the real magic happens. You’ll get to explore each of these settings very thoroughly, from simply setting the range of your light to working with the lightmapping settings. With each explanation, you’ll also see realtime what each setting does visually, so you won’t have to guess as much when experimenting yourself.

As mentioned, this tutorial does explore performance as well. Using Unity’s own analytics tools, you’ll see with data-based evidence how each type of lighting changes how fast your game is, and consequently be able to make more informed choices for the future.

LEARN NOW

Basics of Lightmapping in Unity 2020.1

Duration: 14 minutes

In this tutorial by UGuruz, you’ll take your first step into lighting in the Universal Render Pipeline.

The Universal Render Pipeline (URP) is a a scripted renderer for Unity that is a bit more powerful in terms of how graphics are rendered compared to Unity’s default pipeline. Besides being able to get more realistic looking games, this pipeline also improves the quality of lighting you can get with your game.

The tutorial focuses particularly on making a scene using URP with lightmapping to create baked lighting. You’ll learn important concepts like setting up UVs correctly, parameters available (including options only available to URP), and optimizing your lighting for mobile. In addition, you’ll also explore ambient occlusion for softer shadows which is made particularly powerful by URP.

LEARN NOW

A Quick Lighting Guide for the URP Pipeline in Unity!

Duration: 9 minutes

While the tutorial above is pretty detailed about using lighting in URP, this tutorial by synty studios focuses on the nitty gritty of just getting your lighting working in that pipeline.

Using a fairly complex scene setup, this tutorial covers how to quickly add URP to your project and common settings you’ll work with to just get your scene lite. This includes concepts like setting up your skybox, or how to adjust things quickly just to make lighting suit your scene.

On top of this, this tutorial also covers a tiny bit about post-processes. Post-processes are a way to apply various filters and graphics tweaks to the final render of the game image. While we have other more in-depth tutorials on this topic further below, this tutorial will show you how to quickly work with these processes to add common effects like bloom and color tints – giving you a whole new way to change the look of your scene!

LEARN NOW

Unity HDRP Lighting Tutorial 2020.3 (Day Time)

Duration: 41 minutes

Similar to our previous entries, this tutorial by Amit Patpatia – Lighting Artist covers lighting as it pertain to another pipeline: the High Definition Render Pipeline (HDRP).

As the name of this pipeline suggests, this is Unity’s graphics rendering pipeline made specifically for high-definition, photorealistic graphics. Not only is it the most powerful of Unity’s pipelines, it vastly changes how aspects of the lighting work within the engine.

The tutorial featured here covers lighting as it works for HDRP fairly comprehensively. Like other tutorials, you’ll of course learn how to set up lights, which settings are available, how to use baked and realtime lighting, reflection & refraction, and so forth. However, this tutorial also covers HDRP specific issues related to workflow so you can make sure you’re getting the most out of this heavy duty pipeline.

LEARN NOW

2D Lights and Shadows in Unity 2019!

Duration: 8 minutes

Created by Unity itself, this tutorial dives into lighting for 2D games.

While previous tutorials have focused heavily on 3D graphics and all the great things you can do for them, you can do dynamic lighting for 2D in Unity thanks to the Universal Render Pipeline. With URP setup for your project, you can extend beyond default global lighting and add a variety of cool light and shadow effects previously not available.

The tutorial starts off by getting you set up with URP properly as is needed for 2D games specifically. You’ll then get to explore a variety of new lights offered – including spotlights, directional lights, and freeform lights. With these new lights, you’ll learn to adjust various properties to create specific lighting effects. Some of the things you’ll master include adding shadows under trees, creating sunshafts, and more, all in ways that work regardless of your specific camera view.

LEARN NOW

Octopath 2D Sprite Shadows And Lighting

Duration: 3 minutes

For advanced users out there, this short tutorial will show you how you can light games where you combine 2D and 3D game graphics.

Created by Allen Devs, this tutorial focuses on showing you how to improve your lighting and shadows to get a similar look to the game Octopath. This is primarily achieved through a few different methods. You’ll first explore the advanced topic of creating a shader with C#. While not specific to lighting itself, shaders do affect how light and shadow interact with your objects. As such, it is an important topic to learn, even if beyond the scope of this list.

After this, you’ll get to explore other fixes needed to create the proper effects, including how to adjust your shadows, how to adjust your environment’s lighting, and so forth. On top of this, you’ll also briefly work with post-processing effects until the final render is achieved – teaching you another valuable skill for other tutorials on this list!

LEARN NOW

REALISTIC LIGHTING in Unity!

Duration: 14 minutes

Have realistic graphics in need of realistic lighting? This tutorial by Sykoo has you covered then.

Assuming you’ve already covered the basics a billion times over at this point, this tutorial focuses on just quickly relating the best way to set up a realistic lighting look for your scene using, primarily, real-time lighting. You’ll cover quite a bit about which light settings work best for realism, where it’s often best to place lights, how to manipulate lights for your specific scene, and so forth.

On top of this, and similar to other tutorials, you’ll also cover the very basics of post-processing and learn those specific settings as well that will best bring about the realistic look. While not the most in-depth of tutorials here, given the popularity of realistic lighting, this is still a great one to check out even just for the sake of adding to your personal knowledge base.

LEARN NOW

Create a DAY and NIGHT Cycle in Unity

Duration: 25 minutes

With this tutorial by Zenva, you’ll create a day-night cycle with actual lighting for the sun and moon.

Whereas previous tutorials have been rather static in terms of their scenes, this tutorial will serve as the reminder that Unity is a game engine. As such, our lighting is not limited to a single spot in our level, but can be moved about via script or other similar mechanisms.

The short mini-course will show you how to create a sun and moon effect that seem to rotate around the level from horizon to horizon. This will be implemented along with an adjustable time scale so that, as time passes in your game, the lighting will mimic the cycle appropriately. On top of this, the tutorial also covers how to do things like add different gradients of color to the mix that also change with the time. In this way, you can also get that nice color match for dawn, noon, evening, and night!

LEARN NOW

Lighting And Post-Processing Low Poly Scene

Duration: 13 minutes

In this tutorial by LMHPOLY, you’ll learn the ins and outs of lighting for low-poly models.

To start this tutorial off, you’ll learn tips and tricks for setting up your lights in general. This includes things like where to place them, what settings to use, and also how to bake with lightmaps. Of course, the focus here will be specifically oriented for low poly models and how to achieve the best look for this particular art style.

The other half of this tutorial, though, takes a deep dive into post-processes. As covered earlier, post-processes are what allow you to apply “filters” to the game’s final rendered look. Unlike previous tutorials, though, this tutorial takes a more careful approach and covers a number of different settings, such as aperture, depth of field, chromatic aberration, grain, and exposure. Though you’re left free to experiment and find the look you want, the tutorial serves to demonstrate how lighting and post-processing can be companions in creating your game aesthetic.

LEARN NOW

Unity 2D lighting & post processing effects

Duration: 7 minutes

With guidance from Game Dev Republic, this tutorial covers 2D lighting, post-processing, and tips to make cool-looking scenes.

Of the tutorials on this list, this is one very “light” on the topic of adding lights to the scene itself – featuring really only a single directional light that works in realtime. However, the tutorial makes up for this by taking a much more thorough look into the world of post-processing.

Through this video, you’ll explore a lot of different settings available for post-processing. Of course, you’ll learn a few things already covered on this list, such as adding things like bloom or depth of field. However, the tutorial also covers new things, such as color grading for specific materials versus the entire scene. Altogether, you’ll learn numerous tricks for combining post-processing that works even with minimal lighting and allows you to bring out the best in your 2D graphics.

LEARN NOW

Level Design for Beginners

Duration: 1 hour

Though this tutorial talks about lighting the least, we did want to include it as a bonus resource.

Created by Zenva, this premium course covers principles of game design for creating levels. This includes concepts related to environmental storytelling, making considerations for the genre of your game, and more.

As this is a best Unity lighting tutorials list, though, there is obviously something about lighting here. In this case, you’ll learn quite a bit about how lighting works not only for the environment, but how it guides the player through your game. This includes things like subtlety hinting where players should go, and similar. Thus, if you want to also use lights to improve your levels design-wise, this course can help out in that regard!

LEARN NOW

Parting Words

As we come to a close, we hope you’ve found a tutorial you like from this best Unity lighting tutorials list. Lighting is a huge topic of study that goes beyond just how to implement it in Unity. As such, we encourage you to not only experiment with your lighting, but find out good rules of thumb for how to use it.

Remember, though, that lighting can be extremely powerful! It can take your cutscenes and levels to a new height, and make memorable experiences for your players they’ll never forget. It can also help you emphasize exactly what you’re hoping people will feel at certain parts, or even be used to simply provide player guidance in terms of the design.

Whatever you need to use lighting for, though, we wish you the best of luck in utilizing it for your game projects.

BUILD GAMES

FINAL DAYS: Unlock 250+ coding courses, guided learning paths, help from expert mentors, and more.

]]>