Unreal Engine 5 Tutorial for Beginners: Getting Started

In this Unreal Engine tutorial, you’ll be guided through installing the engine, navigating the interface and creating your first game object. By Matt Larson.

4.9 (10) · 6 Reviews

Download materials
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

Using Materials

To use your material with the submarine, assign it. Return to the Content Drawer and double-click on the Submarine blueprint to open it. Choose the Viewport tab and zoom out to see the whole submarine:

Viewing the Submarine Blueprint

Select all five of the models in the blueprint, then go to the Details panel and find the Materials section. Click the drop-down at the right of Element 0 and select SubmarineMaterial.

Adding the materials to the blueprint

Compile and Save your Submarine blueprint. You’re ready to bring this asset to life with animations!

Adding Logic to a Blueprint

To explore the depths of Unreal Engine, we need to learn a bit more about Blueprints.

Similar to materials, scripting in Blueprints works via a node-based system. That means all you need to do is create nodes and link them. No coding is necessary.

Unreal Engine also supports writing logic using C++, but I recommend you start with the Blueprint system.

Some of the benefits of Blueprints:

  • Generally, it is quicker to develop using Blueprints than C++.
  • Easy organization. You can separate your nodes into areas such as functions and graphs.
  • If you’re working with nonprogrammers, modifying the Blueprint is easy due to its visual and intuitive nature.

A good approach is to create your objects using Blueprints. When you need extra performance, convert them to C++.

About Blueprint Nodes

It’s time to get this submarine moving — animating the propeller is easy in the Blueprint. This is where Blueprint nodes come in.

Unlike their material node cousins, Blueprint nodes have special pins called Execution pins. A pin on the left is an input and a pin on the right is an output. All nodes will have at least one of those.

If a node has an input pin, it must have a connection before it can execute. If a node is not connected, any subsequent nodes will not execute.

Here’s an example:

An example node graph that is missing a connection

Node A and Node B will execute because their input pins have a connection. Node C and Node D will never execute because Node C’s input pin does not have a connection.

Rotating the Propeller

Open the Submarine Blueprint. To start scripting, switch to the Event Graph tab.

Viewing the Event Graph tab

Making an object rotate is so simple you only need to create one node. Right-click a space on the graph to bring up a menu of available nodes. Search for AddLocalRotation. Rotate the submarine_Motor component. Select AddLocalRotation (submarine_Motor).

Note: If the node isn’t listed, uncheck Context Sensitive at the top right of the menu.

Selecting Add Local Rotation to the blueprint

Your graph will now have a new AddLocalRotation node. The Target input will automatically have a connection to the selected component.

To set the rotation value, go to the Delta Rotation input and change the Y value to 2.0. This will cause the Blueprint to rotate around its Y-axis. Higher values will rotate the propeller faster.

Setting the Y value of the motor's rotation

To constantly rotate the turntable, you need to call AddLocalRotation every frame. To execute a node every frame, use the Event Tick node. It should already be in your graph. If it’s not, create one using the same method as before.

Drag the output pin of the Event Tick node to the topmost input pin of the AddLocalRotation node.

Connecting the Event Tick node to the Add Local Rotation node

Note: In this implementation, the rotation rate is dependent on the frame rate — the propeller will rotate at a slower rate on slower machines and vice versa. That’s fine for this tutorial.

Finally, go to the Toolbar and click Compile to update your Blueprint, then close the Blueprint editor.

The editor toolbar

Bring an Actor to the Scene

Adding a Blueprint is the same process as adding a mesh. From the Content Drawer, drag the submarine Blueprint into the Viewport.

Dragging the Submarine Blueprint into the Viewport and moving it around

Objects in a level can move, rotate and scale. The keyboard shortcuts for these are W, E and R.

Just Add Water!

The submarine looks like it’s beached in a desert! How about adding some effects to make it look like the scene is underwater?

First, select the VolumetricCloud in the Outliner and delete this from your scene to remove the clouds.

A simple way to create a blue sea is to add a post-process effect to color the world blue. Post-process effects are those changes applied after the frame is rendered.

Post-process effects are commonly applied to provide stylistic changes such as motion blurs, lighting blooms, and black and white photograph styles.

Add a PostProcessVolume to the scene by clicking the Quick Add button in the Toolbar and selecting Volumes ▸ PostProcessVolume:

The menu for adding a PostProcessVolume

This creates a box. If the camera is inside its extent, it will have the post-process effect applied. Select the newly added PostProcessVolume in the Outliner tree and look at the details. Make sure the box is positioned at the origin and covers the view by setting the Transform to a Location of (X: 0.0, Y: 0.0, Z: 0.0) and Scale of (X: 50.0, Y: 50.0, Z: 50.0).

Setting the position and scale of the PostProcessVolume

To change how the world appears, find the section called Color Grading and set both the Global Contrast and Gamma to a bluish value:

Changing the Color settings on the PostProcessVolume

It should now appear you’re underwater. Hold your breath, but not too long, as you still need to test out the results of all your hard work!
Navigate to the Toolbar and hit Play to see the submarine in action in its natural habitat.

Our underwater submarine :]

Where to Go From Here?

You can download the final project using the link at the top or bottom of this tutorial.

You’ve learned a lot throughout this tutorial, but that’s just a fraction of Unreal. If you want to keep learning more, check out the Unreal Engine Blueprints tutorial and learn more about building logic with blueprint scripting.

Credits

The “Submarine Low-poly” 3D model by Natali_Voitova is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/).