4. Actors – Beginning Unreal Game Development: Foundation for Simple to Complex Games Using Unreal Engine 4

© David Nixon 2020
David NixonBeginning Unreal Game Developmenthttps://doi.org/10.1007/978-1-4842-5639-8_4

4. Actors

David Nixon
(1)
West Palm Beach, FL, USA
 
An Actor is any object that can be added to a Level. In Chapter 2, you were briefly introduced to some of the various types of Actors in Unreal Engine, including Static Meshes, Brushes, Lights, Volumes, and more. In this chapter, you will get a more in-depth look at those Actor types.

Static Meshes

A mesh is a 3D model of an object. There are two specific types of meshes that you can use as Actors in the Unreal Engine. These are the Static Mesh and the Skeletal Mesh.
A Static Mesh is a Mesh that doesn’t bend, deform, or change shape in any way. A Static Mesh can still move around on the screen, it just can’t animate. For example, you could use a Static Mesh in the shape of a cube to represent a cardboard box, and you could have that box slide across a surface, or fall off a table, or fly across the room, but you couldn’t have flaps that open and close. For objects with moving parts, you would use a Skeletal Mesh.
There are a few different Static Mesh Actors in Place Mode of the Modes Panel. Under the Basic tab, there are Static Meshes in the shape of a cube, sphere, cylinder, and cone, as seen in Figure 4-1. These can be dragged into the Level and then positioned, rotated, and scaled as desired.
Figure 4-1
The Modes Panel contains Static Meshes in the form of some basic shapes
While there are some basic Static Meshes in the Modes Panel, more often than not you will be dragging and dropping Static Meshes from the Content Browser that you import in. The Starter Content comes with some Static Meshes, but this is a small supply. You will want to import in meshes that you download or create yourself in a 3D modeling application. Chapter 10 will show you where you can download collections of meshes and other content for you to use in your games and how to import them into UE4.

Replacing the Mesh of a Static Mesh Actor

In Unreal, the Static Mesh itself is actually a property of the Static Mesh Actor. For example, if you drag a mesh of a chair into the Level, Unreal will create a Static Mesh Actor and assign the chair mesh as the mesh to use for that Actor. You could then tell Unreal to use a mesh of a couch for that Actor, and you would have a couch at the same location, rotation, and scale as the chair was.
One way to replace the mesh of an Actor is to use the dropdown in the Static Mesh category of the Details Panel, as shown in Figure 4-2. The dropdown will contain a search box you can use to find the mesh you want to use.
Figure 4-2
You can use the dropdown in the Static Mesh category to replace the mesh asset that is used
Another way is to browse to the replacement mesh in the Content Browser, select it, and then click the arrow in the Static Mesh category of the Details Panel. The arrow will replace the current mesh with whatever is selected in the Content Browser when you click it.

Physics

If you drag a Cube Mesh into a Level, and then click Play, the cube won’t fall to the ground, it will just sit suspended in the air. If you press up against it, it won’t move.
There are two reasons for this. The first reason is that the default Mobility of a Static Mesh Actor is Static. When the Mobility is Static, we are telling the engine that this Actor will never change its position or rotation for any reason. The Mobility will need to be set to Moveable before the cube will be able to move.
The second reason is that Static Meshes have physics turned off by default. To turn on physics for an Actor, with the Actor selected, go to the Physics category (Figure 4-3) in the Details Panel and check the box next to Simulate Physics.
Figure 4-3
The Physics category in the Details Panel
If you were to click Play after changing these two settings, the cube would now fall to the ground, and you would be able to push it along the ground.
The Physics category has several other properties. One of them is the mass of the Actor, measured in kilograms. Objects with more mass require more force applied against them in order to be affected.
The next two properties are Linear Damping and Angular Damping. Damping refers to the amount of drag that is applied to the movement of the object. Similar to having more mass, the more drag an Actor has, the harder it is to move. But in this case, drag is meant to represent friction on the object. For example, if a cube were a smooth block of ice, it would have less drag on it than a rough block of stone, even if the two had the same mass.
The Linear Damping property affects translational movement of the object, meaning a change in location, while the Angular Damping property affects rotational movement of the object, meaning a change in rotation. By increasing Linear Damping, an Actor won’t travel as far when pushed, but will still spin just as easily. Decreasing the Linear Damping to a negative value will cause the Actor to travel farther when pushed and still doesn’t affect the spin. Increasing or decreasing the Angular Damping won’t affect how far the Actor travels in response to force, but will make it easier or harder to spin the object.
Below the Angular Damping property is the Enable Gravity setting. If this is turned off, but Simulate Physics is on, an Actor will still react to force, but gravity will not affect it. This can replicate zero-gravity environments such as outer space.

Brushes

In the world of 3D modeling, a Brush is simply a 3D area of space. This is nearly identical to our understanding of what a Mesh is, but there are several key differences between Brushes and Meshes.

Brushes vs. Meshes

The first difference is that Brushes are used for more basic shapes. In the Modes Panel, in the Geometry tab, you can see the Brushes that are available (Figure 4-4). There are some basic geometric shapes and some Brushes in the shape of stairs. In the Basic tab, we also have some Static Meshes available in the form of basic geometric shapes, but Meshes can be much more complex than this, taking the form of furniture, cars, people, and so on.
Figure 4-4
The Brushes available in the Geometry tab of Place Mode
The second key difference is in how the Unreal Engine handles Brushes and Meshes in memory. For example, let’s say you make several copies of a Brush Actor. Each copy made gets stored in memory, and thus each copy made increases the memory demands of the game. However, no matter how many copies of a Mesh you make, it will not increase the memory needed at all. This is because a single Mesh only gets stored in memory once, no matter how many instances of it there are in your Level.
So Meshes look better and they perform better, but the advantage of Brushes is that they are easier to edit than the more complex Meshes. This makes Brushes better suited for making a prototype, or a rough draft, of a Level. So you can use Brushes to sculpt the basic layout of your Level and then replace those Brushes with Meshes once the layout is finalized. In theory, once you have the basic layout sculpted in Brushes, you won't need to keep making minor changes over and over to the more difficult to edit Meshes. While the final version of most games will have very little or no Brushes in it at all, chances are each of its Levels started out made almost exclusively as Brushes.

Brush Settings

Brushes have several different properties available for you to edit under the Brush Settings category of the Details Panel (Figure 4-5).
Figure 4-5
Brush Settings for a Box Brush

Brush Type

Some of these properties are different, depending on the base shape of the Actor, but one property that is common to all Brushes is Brush Type . The Brush Type for any Brush can either be Additive or Subtractive. You can choose what type you want your Brush to be, before you drag it in, by choosing the type in the Modes Panel. Or you can change the type of an existing Brush, by changing it in the Details Panel.
The Additive type is pretty straightforward. An “additive” Brush will add geometry to the Level. A subtractive Brush, on the other hand, will subtract from existing geometry in the Level. For example, if a subtractive Cylinder Brush is dragged onto an additive Box Brush, wherever the subtractive Cylinder Brush is overlapping is causing the geometry that was there to be removed. You can think of subtractive Brushes as “holes” in the shape of the Brush.
This feature is one of the main reasons why Brushes are so well suited to sculpting overall Level design. By adding and subtracting geometry in this way, you can sculpt the layout of a Level much faster than you could trying to use Meshes.

Brush Shape

The next property under Brush Settings is Brush Shape . Brush Shape simply refers to if the Brush is in the shape of a box, a cylinder, a cone, and so on. You can choose which Brush Shape to use by choosing which Actor to drag into the Level, but you can also change the shape of an existing Brush Actor in the Brush Settings category.

Size Properties

Some of the properties in Brush Settings are dependent on the shape of the Brush being used. For example, a Box Brush will have X, Y, and Z properties denoting the length of the Box in those dimensions. Adjusting these values will adjust the size of the Box. This is similar to using the Scale property in the Transform category, with one key difference when it comes to Materials that I will talk about in the section on Materials.
The Cylinder and Cone Brushes have their size determined by just a Z length and an Outer Radius property. The Z is how tall the cone or cylinder is, and the Outer Radius is how wide around it is. For the Cone, this is the radius as measured at the base. For the Sphere Brush, radius is the only property used to determine its size.

Sides Properties

The Cylinder and Cone Brushes also have a property called Sides . As you might have noticed already with these Brush shapes, their “curved” edges, so to speak, aren’t actually curves, but are made up of a series of flat sides. The Sides property determines how many of these flat sides the Brush has. The more sides it has, the smoother around it will appear.
The Sphere Brush has a property similar to this, which is the Tessellation factor. The higher this number is, the more sides the sphere will have, and the smoother it will appear.
The Cylinder and Cone Brushes also have the property Align to Side. If this is checked, it will align the sides of the Brush with the grid.

Hollow Property

Another property of Brushes that is common to the Box, Cone, and Cylinder Brushes is whether or not the Brush is Hollow . This is just what it sounds like. If this property is checked, instead of the Brush being solid all the way through, it will be hollow inside, and the Brush will essentially be a shell, with walls of some thickness. For Box Brushes, this is set with the Wall Thickness property. For Cylinder Brushes, this is set by the Inner Radius property. The Inner Radius is the radius of the hollow part. For Cone Brushes, this is set by both the Inner Radius property and the Cap Z property. The Cap Z property determines how tall the hollow area is within the cone. For each of these, the property is grayed out unless the Hollow property is checked.
One thing the Hollow feature is particularly useful for is for quickly creating rooms or buildings. This can be done by making a large Box Brush, setting it to Hollow, and then using a smaller, subtractive Box Brush to make a doorway.

Stair Brushes

The Linear Stair , shown in Figure 4-6, is the simplest of the three Stair Brushes. It has Length, Height, and Width properties to determine the size of each individual step (Figure 4-7). You can also choose the number of steps for the staircase. The default is 10 but you can make this larger or smaller as you wish.
Figure 4-6
A Linear Stair Brush
The Add to First Step property is essentially a Step Height property for the first step only. While the Step Height property increases or decreases the height of all of the steps, the Add to First Step property will only affect the height of the first step.
Figure 4-7
Brush Settings for a Linear Stair
The Curved Stair (Figure 4-8) has some of the same properties as the Linear Stair, such as Step Height, Step Width, Number of Steps, and Add to First Step. But it also has some other properties that pertain to its curve (Figure 4-9).
Figure 4-8
A Curved Stair Brush
Figure 4-9
Brush Settings for a Curved Stair
The first of these properties is the Inner Radius. Imagine the Curved Stair wrapping around an invisible column. When the Curved Stair is selected, you will see the Transform tool at the center of this invisible column. The Inner Radius property sets the length between the center of this invisible column and the edge of the staircase. In other words, it affects the width of this “invisible column.”
Next is the Angle of Curve property. This will set the angle that is made between the two vectors pointing from the center of the invisible column to each end of the staircase. The default is 90 degrees.
Last is the Counter Clockwise property. This one is pretty straightforward. With this unchecked, the staircase will curve in a clockwise direction. With it checked, the staircase will instead curve in a counterclockwise direction.
The final staircase is the Spiral Stair (Figure 4-10), whose Brush Settings category can be seen in Figure 4-11. With the Spiral Stair, the Step Height property is a little different than it is on the other two stairs. With the Spiral Stair, the Step Height won’t affect how tall each step is, it will affect how much each step overlaps the step above and below it.
Figure 4-10
A Spiral Stair Brush
Figure 4-11
Brush Settings for a Spiral Stair
At the Default Value, each step overlaps its adjacent steps by about 50%. But if the value is increased, the amount of overlap will begin to decrease, and eventually the steps will no longer overlap and begin to have some distance from each other. If you want to make each step actually taller, you need to use the Step Thickness.
The Spiral Staircase has a Num Steps property like the other two, but it also has a Num Steps Per 360 property. This defines the number of steps in one full spiral of the staircase.
The next property is the Sloped Ceiling property. With this unchecked, the underside of the staircase will just resemble upside down stairs. If it is checked, it will make the underside completely smooth. With the Sloped Floor property, you can change the top surface of the staircase to be perfectly smooth. You can, in essence, change a staircase into a curved ramp.

Materials

In the Unreal Engine, a Material is an asset that you can apply to the surface of a Brush or Mesh, to make that surface, and thus the geometry behind that surface, look like it’s made out of a certain substance. For example, you could resize a Box Brush and use it as a wall. Then, if you apply a wood Material to the wall, it will look like a wooden wall.
Note that, while this chapter is focusing on the different Actor types, Materials aren’t Actors themselves. They are simply an important property of Mesh and Brush Actors which is why they are being discussed here.
To apply a Material to a surface, select the Material in the Content Browser and drag it into the Viewport and onto the surface you wish to apply it to, as shown in Figure 4-12.
Figure 4-12
Drag a Material onto a surface to apply it to the surface

Apply Material to All Surfaces

If you want a Material to be applied to all the surfaces of a Brush, one way to do this is to select the Material first, and with that Material selected in the Content Browser, drag the Brush Actor into the Level, and it will get created with that Material applied to all the surfaces of the Brush.
If you want to apply a Material to all the surfaces of a Brush that is already existing in your Level, perform the following steps:
  1. 1.
    Make sure you don’t already have the Brush selected. If you do, just click one of the other Actors in the World Outliner.
     
  2. 2.
    With the Brush unselected, click one of the surfaces of the Brush to select just that surface. When only a surface or surfaces of the Brush are selected, and not the Brush itself, the Surface Materials, Geometry, and Surface Properties categories will appear in the Details Panel.
     
  3. 3.
    Go down to the Geometry category and click “Select,” then “Select All Adjacent Surfaces,” or use the shortcut Shift+J, and now all the surfaces of the Brush will be selected.
     
  4. 4.
    Drag a Material onto the Brush and it will apply that Material to all the surfaces.
     

Surface Materials Category

In addition to dragging and dropping, another way you can apply a Material to a surface is to use the Surface Materials category of the Details Panel (Figure 4-13). This works just like replacing the Static Mesh did in the earlier section.
Figure 4-13
The Surface Materials category
You can use the dropdown box to select the Material you want to use. Or you can select the Material you want to use in the Content Browser and then click the arrow to apply it. Or, if you want to find the Material that is currently applied in the Content Browser, click the magnifying glass to go straight to it.

Elements

A single Mesh can have different Materials applied to different parts of it. When a mesh gets created in a 3D modeling program, such as Maya or 3D Studio Max, if it has different materials applied to different parts of its surface, once that mesh gets imported into the Unreal Editor, each of those sections of surface becomes known as Elements, and you will have the ability to apply a different Material to each Element, as seen in Figure 4-14.
Figure 4-14
Each Element of a Mesh can have a different Material
If you drag a Material onto the Mesh through the Viewport, the Material will only be applied to the specific Element it was dragged onto. In the Details Panel, in the Materials category, there will be one Element for each Material, and you can set them each individually.

Textures

I won’t go into too much detail about Textures in this beginner-level book, but just know that Textures are what Materials are made of. A Material is made up of one or more Textures, and each Texture is just an image file that defines one of the properties of the Material. So one Texture may be the actual colors of the Material, while another Texture maps its smoothness or roughness, and so on. This data is combined to form the composite Material.
Textures should be square image files with dimensions that are powers of two. For example, images whose dimensions, in pixels, are 64 x 64, 1024 x 1024, 2048 x 2048, and so on. UE4 supports importing the following formats for use as textures – .bmp, .png, .jpg, .float, .pcx, .psd, .tga, .exr, .dds, and .hdr.
The Textures dropdown in the Materials category of the Details Panel will show you the Textures that make up the currently applied Material. If you select one, it will take you to that Texture in the Content Browser.

Surface Properties Category

When a Material is applied to the surface of a Brush, and you select that surface, there will be a Surface Properties category in the Details Panel (Figure 4-15). Before we discuss that, however, you need to understand how the axes of a Material are labeled. A Material is a two-dimensional object, and normally you would use X and Y as the names of the axes of a 2D object. However, X and Y are already being used to describe two of the axes of our Levels. To avoid confusion, the letters U and V are used for the axes of a Material.
Figure 4-15
The Surface Properties category
At the top of the Surface Properties category is a section where you can pan the Material across the surface of the object. The first row of buttons is used to pan the Material along its U-axis. The different values represent how much to pan with each click. The last column can be used to enter a custom amount. The second row of buttons is used to pan the Material along the V-axis.
Below that is a section where you can rotate the Material relative to the surface it’s on. You can toggle which direction the Material will rotate, either clockwise or counterclockwise, and then there are buttons to rotate it 45 degrees, 90 degrees, or a custom amount.
To the right of that is a section where you can flip the Material, either along the U-axis or the V-axis.

Material Scaling

When you scale an Actor, the Material that is applied to it will get scaled as well, meaning it will get stretched or compressed. Even if you scale the Actor first, and then apply the Material, the effect will be the same.
With Static Meshes, there’s no way around this. Brushes, however, are a bit more flexible. If the Material on a Brush surface gets scaled, you can see it in the Details Panel, in the Scale section of the Surface Properties category. To reset the scaling, you simply need to set the Scale property back to a 1:1 ratio and then click the Apply button.
With Brushes, you can edit the dimensions directly, instead of having to rely on scaling. When you change the size of a Brush in this way, it doesn’t change the scale ratio of the Material. So if you use the X, Y, and Z properties of the Brush, under the Brush Settings category, to change the size of the Brush, no matter what size you make the Brush, the ratio will remain 1:1.

Lights

In Unreal Engine, a Light is simply an Actor that will generate light for your Level. They are not meant to represent the object producing the light, only the light itself. You would use a Mesh for, say, a lamp or a flashlight and then use a Light Actor to produce the light itself.
Wherever you place the Light Actor in the Level is where the light will emanate from. If an object gets in the path of some light, the engine will generate shadows. Lighting and shadows take a relatively long time to render, so there are various settings meant to help you save on performance cost, such as the Mobility setting, discussed later on in the section. There are also different types of Light Actors in UE4, depending on the type of light source you are trying to mimic. These are discussed in the following section.

Overview of Light Types

There are five types of Light Actors in Unreal, as seen in Figure 4-16.
Figure 4-16
The five Light Actors available in Unreal
The first of these is the Directional Light Actor. The Directional Light Actor is used to emulate light coming from an extremely long distance away, such as outer space. All the light will hit the level at the same angle, meaning all shadows produced by this light will be parallel. This Actor is used primarily for sunlight and moonlight.
Next is the Point Light . The Point Light will produce light that emanates in all directions. This is useful for mimicking the light coming from a light bulb, or fire, for example.
The Spot Light, on the other hand, will emit light in the shape of a cone. This is like the light coming from a flashlight, or, as the name suggests, a spot light, like they use at the theater.
The Rect Light, or Rectangular Light, projects lights out of a rectangular plane. This is useful for representing any light sources that are rectangular in shape, such as televisions, monitors, smartphones, overhead lights, and so on.
The Sky Light Actor is used to emulate the light that gets reflected off of the atmosphere and other distant objects. When light comes from the sun or moon, a lot of it comes through as direct sunlight or moonlight. That’s what the Directional Light Actor mentioned earlier represents. But some of that sunlight or moonlight hits particles in the atmosphere, or clouds, or distant mountaintops, and then gets reflected off of those objects at a different angle. The Sky Light Actor represents that light that gets scattered in the atmosphere, or reflected off of other objects, and that comes through as weaker, indirect sunlight or moonlight at all different angles. In simpler terms, you could say it represents the faint glow of the atmosphere.

Building the Lighting

Changes to a Level will not affect the lighting like they should until the Editor is told to build the lighting.
Building the lighting just means that the Engine runs a lot of calculations to determine how the light and shadows should now look on objects based on the changes that have occurred since the last time the lighting was built.
To build the lighting, simply go up to the Toolbar and click the Build button (Figure 4-17). The reason the Editor has you do this manually is because when you start to have many Actors and/or Lights in your Level, the build can take quite a while to perform. So, even if it only took ten seconds, you wouldn’t want to have to wait those ten seconds every time you moved an Actor in your Level. This allows you to build only when you’re ready.
Figure 4-17
The Build button

Mobility

In the Transform category of a Light Actor or Static Mesh Actor is the Mobility property (Figure 4-18). If an Actor is Static, that means it can’t move or change any other property while the game is running. If an Actor is Stationary, it still can’t move, but it can change its other properties during the game; a Light could change its color or brightness, for example. If an Actor is Moveable, it can move and change its other properties during the game.
Figure 4-18
The Mobility property in the Transform category
As you move to the right along these three settings, they get more flexible in terms of what the Actor can do, but they also demand more resources from the processor. Actors set to Static have low performance cost, Actors set to Stationary have medium performance cost, and Actors set to Moveable have high performance cost.
The Mobility settings of two or more Actors when they interact also affect performance. For example, when a Light Actor shines light on a Static Mesh Actor, the way that the light and shadows are rendered depends on the combination of Mobility settings. A Light set to Static shining on a Static Mesh set to Static, for instance, will use mostly precomputed lighting and shadows and have a low performance cost. On the other hand, a Light set to Moveable shining on a Static Mesh set to Moveable will use all dynamic lighting and shadows and have a very high performance cost.

Directional Light

The Directional Light , shown in Figure 4-19, is used to represent sunlight or moonlight. It has several properties that can be viewed and edited in the Details Panel.
Figure 4-19
A Directional Light Actor

Intensity

In the Light category of the Details Panel, shown in Figure 4-20, the first of these properties is Intensity . This controls the brightness of the Light. Increasing the Intensity makes the Light get brighter and decreasing the Intensity makes the Light get dimmer.
Figure 4-20
The Light category properties of a Directional Light

Light Color

The next property is the Light Color. By default, the color of a Light is white, but this can be changed. There are two ways to change the Light Color property. One way is to click the triangle to the left of the property name and expand the RGB menu. With the RGB menu, you can adjust the amount of red, green, and blue in the Light to determine its overall color.
The second way to edit the Light Color is to click the strip, to the right of the property name, that previews the color. This will open the Color Picker, shown in Figure 4-21. The Color Picker is available in several places in the Unreal Editor where there is a need to select a color.
Figure 4-21
The Color Picker
The Color Picker actually gives you several ways in which you can select a color. You can select one from the color wheel. You can adjust the saturation and the brightness using a pair of sliders. You can set the Hue, Saturation, and Brightness values directly. It is another place where you can set the Red, Green, and Blue values. And finally, you can use the hexadecimal representation of a color if you wish.

Source Angle

The next two properties are Source Angle and Source Soft Angle . These affect how soft the shadows produced by the Directional Light are. The higher the value, the softer the edges of the shadows will be. The default value of 0.5357 for Source Angle is meant to represent how shadows should look in sunlight.
Be aware that these properties take advantage of a new computer graphics technology called raytracing, which is only supported by the latest graphics cards. If you haven’t bought an expensive graphics card or a new gaming computer recently, there’s a good chance you won’t see any difference by changing these properties.

Temperature

The next two properties relate to the Temperature of the Light. Temperature changes the color of the Light based on how hot you tell the Engine the light source is supposed to be. By default, Temperature is not used, but if you want to use it, you can check the Use Temperature property.
If you’ve ever looked at the fire in a fireplace, for example, you will notice it’s made up of different colors. Most of it is red, but as you go inward, it starts to get more orange, and then you may see wisps of purple and blue. The bluish parts are actually the hottest parts of the fire. So as the Temperature setting is decreased, the Light will shine redder, and as it is increased, the Light will shine bluer.

Affects World

The next property is Affects World . This simply toggles whether the Light is enabled or disabled. If this is unchecked, it will be as if the Light isn’t even in the Level.

Cast Shadows

The next property is Cast Shadows , which determines if the Light will cause shadows to be cast when objects block the Light’s path. You would want this checked for a more realistic environment. However, shadows are processor intensive, so if you were in need of performance savings, you might choose to uncheck this for some of the Lights in your Level.
When this property is checked, there are a couple more properties you can configure relating to casting shadows. These are Cast Static Shadows and Cast Dynamic Shadows, which can be found by expanding the Light category. Cast Static Shadows determines whether or not this light should cast a shadow when shone on static objects, such as a Static Mesh Actor whose Mobility is set to Static. Cast Dynamic Shadows determines whether or not this light should cast a shadow when shone on dynamic objects, such as a Static Mesh Actor whose Mobility is set to Stationary or Moveable.

Indirect Lighting Intensity

The next property is Indirect Lighting Intensity . If some light gets reflected off of another surface, that reflected light is called “indirect lighting” and can also light up objects in the Level. This property will determine how much this reflected light affects the other objects it shines upon.

Volumetric Scattering Intensity

The last property in the Light category is Volumetric Scattering Intensity . This property applies to fog, which will be covered in the next section. When light passes through fog, it will scatter in various directions. The higher the Volumetric Scattering Intensity, the more the light will scatter.

Point Light

The Point Light emanates light in all directions. It has many of the same properties that the Directional Light has, with a few additional ones as well, as seen in Figure 4-22.
Figure 4-22
The Light category properties of a Point Light
The first of these is the Attenuation Radius. This determines how far from the source the Light will still affect objects in your Level. In the Level Editor, this is represented by a blue sphere (Figure 4-23). The higher the Attenuation Radius, the larger the sphere will be, and the farther the light will extend from its source.
Figure 4-23
The attenuation sphere surrounding a Point Light
The next three properties are Source Radius, Soft Source Radius , and Source Length. The light from a Point Light will actually emanate from a single point in the Level. However, let’s say you have a Light that is supposed to be coming from a long, thin fluorescent bulb, and it is above a very shiny floor. If there were a reflection of the bulb in the floor, you would want it to be in the same shape as the bulb. You can use these three properties to adjust the size and shape that the light source will appear in reflections.

Spot Light

The Spot Light is very similar to the Point Light, except that instead of shining light in all directions, it shines it in a specific direction, in a cone shape, as seen in Figure 4-24. The Spot Light has all the same properties as the Point Light, with the addition of two more properties – the Inner Cone Angle and the Outer Cone Angle.
Figure 4-24
A Spot Light Actor
Within the Inner Cone of the Spot Light, the light will be at its brightest and will be just as bright at any spot within the Inner Cone. From the outer edge of the Inner Cone to the outer edge of the Outer Cone, the Intensity of the light will gradually fall off to nothing.
So you can use the Inner Cone Angle and the Outer Cone Angle to set the size of these cones and determine how much of the light is at full brightness and how much of the light is part of the gradual falloff portion.

Rect Light

The next light is the Rect Light . This Actor emits light in a rectangular shape. The first of its unique properties are Source Width and Source Height. These are used to represent the size of the light source. For example, a 90-inch television would require a larger Source Width and Source Height than a 24-inch television would.
The next two properties are Barn Door Angle and Barn Door Length. A barn door, in the context of lighting, is a set of flaps attached to the front of the light. They are usually used on studio lights, and they help the photographer, cinematographer, and so on make subtle adjustments to the lighting by adjusting the angle of the flaps. You can use the Barn Door Angle and Barn Door Length properties to emulate those kinds of effects.
The next property is Source Texture. You can apply a texture to the light, just like you would with a Material, and then the light will look as if it is being filtered through that texture.

Sky Light

The Sky Light (Figure 4-25) is used to represent the reflection of light from the atmosphere or faraway objects in the sky such as clouds or mountaintops. To determine at what distance this Light should appear to emanate from, we need to define at what distance the sky should be considered to start.
Figure 4-25
A Sky Light Actor
By default, the Sky Light’s Source Type property will be set to “SLS Captured Scene,” which just means that the sky will be defined as any point that is the Sky Distance Threshold away from the Sky Light Actor. So if the Sky Light is placed at the center of the Level, with a Sky Distance Threshold of 150,000, you are saying that the sky should begin 150,000 units from the center of the Level.
There is also the option to change the Source Type to “SLS Specified Cubemap” and then provide a file called a Cubemap to define the area that should be considered the sky. Cubemaps, however, are beyond the scope of this beginner-level book.

Fog

Atmospheric Fog

The Atmospheric Fog Actor is used to add a realistic looking atmosphere to a Level, as seen in Figure 4-26. The Atmospheric Fog Actor can be found in the Visual Effects tab in Place Mode of the Modes Panel.
The Directional Light Actor can be used to represent sunlight, but this alone won’t make the Level look like it’s outside. Atmospheric Fog will add a blue sky and a sun disc and will cause objects to get a little foggy when they are far away in the distance.
Figure 4-26
The Atmospheric Fog Actor adds an atmosphere to the Level

Sun Disc

By default, the sun disc of the Atmospheric Fog will appear on the horizon, giving a look of sunrise or sunset. But it is possible to combine the Atmospheric Fog Actor with the Directional Light Actor, which will cause the sun to appear in the sky, like it does in Figure 4-27. To do so, check the property Atmosphere/Fog Sun Light of the Directional Light Actor. This property can be found in the Light category, after clicking the arrow to expand the menu.
Figure 4-27
Here, the Engine is using the rotation of the Directional Light to determine where to place the sun disc in the sky
If the Atmosphere/Fog Sun Light property is checked, the Atmospheric Fog will use the rotation of the Directional Light to determine where the sun disc should be placed in the sky. The Engine will look at the direction that the light rays from the Directional Light are set to hit the Level and then calculate where in the sky the Sun should be for that to make sense. If you use the Rotation Tool on the Directional Light to change the angle of the light rays, it will change the location of the sun disc in the sky.

Atmospheric Fog Properties

The first property under the Atmosphere category (Figure 4-28) is Sun Multiplier. The higher its value, the brighter the sky and the fog will appear. In other words, you can use it to make the Level look more or less sunny.
Figure 4-28
The properties of an Atmospheric Fog Actor
The next three properties affect the fog only. They are also somewhat subtle in their effects, especially when the fog is far away. The Fog Multiplier property affects how much the light affects the fog. Higher values will make the fog seem brighter. The Density Multiplier affects how dense the fog is. Higher values will make the fog denser, and lower values will make it less dense. The Density Offset affects the opacity of the fog. Higher values will make the fog more opaque, while lower values will make the fog more transparent. Basically, these three properties will make the fog seem more or less thick in subtly different ways.
The next property is Distance Scale. This will affect the scale of the units of any other properties of the Actor that have to do with distance. For example, changing the Distance Scale from 1 to 2 will cause any distance units to be double in length. Setting the Distance Scale higher is useful when you have a large Level, and it would be easier to work with larger units of distance.
The Altitude Scale is just like the Distance Scale except it only affects the Z-axis, whereas the Distance Scale affects all three dimensions.
Next is the Ground Offset property. This tells the Engine where sea level should be considered to be at in our Level. This is important to the Atmospheric Fog Actor, as the fog will only appear at places above sea level. The default value is -100,000. This is saying that sea level starts at -100,000 on the Z-axis. So if the ground of our Level is placed at 0 on the Z-axis, this means that our Level is 100,000 centimeters, or 1000 meters, above sea level.
The Start Distance property controls how far away from the camera the Level will start to appear foggy. Higher values will make the fog appear distant, and lower values will make the fog appear close.
Under the Sun category, the first property is Sun Disc Scale. The Sun Disc Scale property is very straightforward. It simply defines the size of the sun disc. Increasing its value will make the sun appear bigger in the sky (Figure 4-29), and decreasing its value will make the sun appear smaller.
Figure 4-29
Setting the Sun Disc Scale to a high value will make the sun appear large in the sky

Exponential Height Fog

The Exponential Height Fog Actor is used to add regular fog to your Level. The reason it has “Height” in its name is that the altitude will affect the thickness of the fog. Lower altitudes will have thicker fog, while higher altitudes will have thinner fog. The altitude is calculated relative to the Fog Actor’s position.
Now let’s take a look at some of its properties. The first property in the Exponential Height Fog Component category is Fog Density. This one is pretty self-explanatory. The higher the value, the denser, or thicker, the fog will be.
The next property is Fog Height Falloff. This property controls how quickly the fog changes thickness as the altitude changes. Higher values cause the fog to change quickly with only small changes in altitude, while lower values make it so that large changes in altitude are required to see any change in fog thickness.
Next, the three properties under Second Fog Data allow you to create a second layer of fog. Fog Density and Fog Height Falloff work the same way as they do for the first fog layer. Fog Height Offset sets the Z value of the second fog relative to the location of the first fog. For example, if Fog Height Offset is set to 100, then the second fog will be 100 centimeters above the first fog.
The next property, Fog Inscattering Color, simply sets the color of the fog. The color can be set either by the Color Picker or by setting its RGBA properties.
The next property, Fog Max Opacity, sets how opaque the fog can get at its thickest point. With a value of 1.0, the fog will be able to be fully opaque at low altitudes, meaning you won’t be able to see through it at all. With a value of 0, the fog will be completely invisible at any altitude.
The next property, Start Distance, is used the same with the Exponential Height Fog Actor as it is with the Atmospheric Fog Actor. With a value of 0, the player will be directly inside the fog, while higher values will cause the fog to appear at a distance.
Finally, the Fog Cutoff Distance property determines how far away an object has to be to not have any fog effect applied to it. Objects beyond the distance specified will not be affected by the fog.

Player Start Actor

If a Level does not contain a Player Start Actor , the player will begin the Level at position (0,0,0). If you want to have control over where the player will start the Level, you need to place a Player Start Actor.
The Player Start Actor can be accessed from the Modes Panel under the Basic tab. Wherever you place it is where the player will start when the Level begins. It can also be used to specify the direction the player should be facing when the Level starts. The light blue arrow coming out of the Actor indicates the direction (Figure 4-30). You can rotate the Actor to change the direction the arrow is pointing.
Figure 4-30
The Player Start Actor
If you ever place your Player Start Actor somewhere in the Level where it intersects with another object, the icon of the game controller will change to a label that says “Bad Size” (Figure 4-31). To make sure the player doesn’t start the Level stuck in something, move the Player Start Actor to a position where the icon shows the controller instead.
Figure 4-31
If the Player Start Actor intersects with another object, it will display a “Bad Size” label
While you are developing your Levels, you will often want to test something or look at something in-game right in the spot you are at in the Viewport at that moment instead of wherever the Player Start Actor might be. To do so, right-click the Viewport and then choose Play From Here toward the bottom of the menu.
If you want to move around the Viewport and continually start the Level at wherever you are at that moment, you can go to the dropdown menu to the right of the Play button and choose Spawn player at…Current Camera Location. When you want to go back to using the Player Start Actor, go back to the dropdown menu and choose Spawn player at…Default Player Start.

Components

Components are various objects or functionality that can be attached to Actors. There are many different kinds of Components. Some of the types of Components are objects that are also used as Actors on their own. For example, you could attach a Static Mesh as a Component to another Actor. Or, you could attach a Light as a Component to another Actor.
Other Components, such as Movement Components, do not have their own Actor type and are only used as Components on other Actors. For example, a Rotating Movement Component attached to an Actor will cause that Actor to rotate, but doesn’t have any use on its own.

Adding Components

When you want to attach a Component to an Actor, select that Actor, then go over to the Details Panel and click the green button that says Add Component. You’ll get a long list of different Components you can add, grouped by category (Figure 4-32). There will also be a search bar that you can use to quickly find a type of Component by name.
Figure 4-32
Use the Add Component button in the Details Panel to add a component to an Actor
To add a Static Mesh from the Content Browser as a Component, after clicking Add Component, instead of choosing one of the pre-made meshes available in the Modes Panel, click the generic “Static Mesh.” This will add an empty Static Mesh Component to the Actor. You can then choose which Static Mesh to use by using the Static Mesh section of the Details Panel.

Component Structure

Below the Add Component button is a section where you can see the Component structure of an Actor (Figure 4-33). There is a parent-child relationship where Components can have sub-Components which, in turn, can have their own sub-Components. Sub-Components will appear underneath their parent Components and will be indented further to the right than their parent. If you move or rotate a Component, it will move or rotate all of its sub-Components as well.
Figure 4-33
The Component structure of an Actor. Here, a Spot Light is a child of a Static Mesh, which is a child of an Actor named “Cylinder”

Rotating Movement Component

A Rotating Movement Component will cause the Actor it is attached to to rotate. It can be added by clicking “Add Component,” going down to the “Movement” category, and selecting “Rotating Movement.” If the Mobility setting of the Actor has been set to Moveable, it will begin to spin around as soon as the Level begins.
The Rotating Movement Component has some properties you can edit (Figure 4-34). The first property is Rotation Rate, which specifies how much to rotate the Actor and in which direction. Whatever angle you enter, it will rotate the Actor that many degrees per second. For example, setting the rotation around the Z-axis to 180 degrees will cause the Actor to spin one full 360-degree rotation, in that direction, every two seconds.
Figure 4-34
The properties of a Rotating Movement Component
Another property you can edit is the Pivot Translation. By default, with this at (0,0,0), the Actor will rotate around its center. However, you can enter X, Y, and Z values to change the pivot point to a different location. For example, a value of 100 for the X value will cause the Actor to rotate around a point 100 units, along the X-axis, from the center of the Actor.

Volumes

In the Unreal Engine, a Volume is a 3D area of space that is invisible to the player and serves a specific purpose depending on its type. A Volume is actually another type of Brush. However, for the remainder of this book, Volume Brushes will be referred to as simply Volumes in order to avoid confusion with Geometry Brushes. You can access a variety of Volumes from the Volumes tab in the Modes Panel (Figure 4-35).
Figure 4-35
There are several Volumes available in the Volumes tab of Place Mode

Blocking Volumes

A Blocking Volume will prevent Actors from being able to enter that Volume. So you can use them as a type of force field or just to block off areas of your Level where you don’t intend for players to go.
A Camera Blocking Volume is just like a Blocking Volume except it only blocks Cameras. This is useful in third-person games when you want to keep the Camera confined to certain parts of the Level.

Trigger Volumes

Perhaps the most important type of Volume is the Trigger Volume , shown in Figure 4-36. Trigger Volumes are used to trigger something called an Event when an Actor enters or exits them. In the next chapter, Blueprints, you will learn how to define a set of instructions for the Engine to perform when certain Events occur.
Figure 4-36
A Trigger Volume
For example, if you had a haunted house in your Level, you could place a Trigger Volume in the doorway of the entrance and name it “PlayerEntersHouseVolume.” Then, using a Blueprint, you would be able to define an Event, and name it something like “PlayerEntersHouseEvent,” that should fire off a set of instructions any time the player enters the PlayerEntersHouseVolume.
Those instructions could be anything you want, such as playing a scary sound file, or having the Mesh of a bat fly around the room, or playing a video, and so on. The end result would be that any time the player enters that doorway, something specific happens.
To give you another example, let’s say you have a racing game. You could place a Trigger Volume at the finish line so that when the player reaches that point it will trigger the Event that handles the end of the race.

Pain Causing Volumes

A Pain Causing Volume will cause Damage to an Actor who enters that volume. For example, you could surround a fire with a Pain Causing Volume so that a player takes Damage if they “enter the fire.” Damage is a built-in concept in the Unreal Engine, and you can use Blueprints to define what happens when an Actor takes Damage, such as subtracting from their health based on the amount of Damage done.
The first property of Pain Causing Volume is simply called Pain Causing (Figure 4-37). This will determine if the Volume will actually apply Damage to Actors that enter it. By unchecking this, it will disable the Pain Causing feature of the Volume.
Figure 4-37
Properties of a Pain Causing Volume
The next property is Damage Per Second. This determines the rate at which the Actor inside the Volume is damaged. But note that it does not determine the interval at which the Damage is applied. That is set by the Pain Interval property.
For example, with them both set to 1, every second a point of Damage will be applied. If the Pain Interval was changed to 0.5, then Damage would be applied every half-second. However, now only half a point of Damage would be applied each time, so that, overall, the Actor is still only receiving 1 point of Damage per second. If the Pain Interval was changed to 2, then Damage would only be applied every 2 seconds, but it would apply 2 points of Damage each time.
An easy way to calculate how much Damage will be applied at each interval is to multiply the two values together. So if the Damage Per Second is 2, and the Pain Interval is 4, then 8 points of Damage will be applied at each interval.
The Damage Type allows you to change the overall way that Damage by the Volume is handled by the Engine. However, in almost all cases, you will just want to leave this on the default.
The Entry Pain property specifies whether or not Damage should be applied to the Actor immediately upon entering the Volume. With Entry Pain checked, the Actor will receive Damage immediately and then again after every interval. With Entry Pain unchecked, the Actor will not receive any Damage until the first interval has elapsed.

Kill ZVolume

The Kill ZVolume will destroy any Actor that enters it. It is useful for defining any places in your Level that mean instant death. For example, if you had a pit of lava in your Level, you might want to surround the pit with a Kill ZVolume. Or if you wanted to kill a player that had fallen off a ledge into a bottomless pit, you could use a Kill ZVolume.
You can define in Blueprints what should happen when the player is destroyed, such as displaying a Game Over menu.

Physics Volume

The Physics Volume allows you to change the physics of the space within the Volume.
Its first property is Terminal Velocity (Figure 4-38). Terminal velocity is the maximum speed that something can reach when it’s falling, or, put another way, the maximum speed something can reach due to the forces of gravity.
Figure 4-38
Properties of a Physics Volume
When something falls, if nothing interrupts the fall, the object will continue to accelerate until it reaches the Terminal Velocity, and then it will no longer accelerate; it will fall at a constant speed. In the real world, all objects falling toward the Earth have the same terminal velocity. But this value will be different on other planets that have different amounts of gravity.
So you could use the Terminal Velocity property to better mimic an alien world, or you could use it to produce other effects. For example, reducing the Terminal Velocity of the Volume to something really low, so that objects fall very slowly through it.
The next property is Priority. This is used when two Physics Volumes are overlapping, in order to determine which Volumes’ settings should be used for that overlapping space. The higher the value, the higher the priority. So if a Physics Volume with a Priority of 0 overlapped a Physics Volume with a Priority of 1, only the settings for the Volume with a Priority of 1 would be honored within the overlapping space.
The next property is Fluid Friction. This is used to mimic the friction that occurs when something passes through something semi-solid. For example, trying to walk through water is a lot more difficult than walking through air, because there is a lot more friction. Walking through mud is more difficult than walking through water. The higher the Fluid Friction, the slower that objects will pass through it.
Last is the Water Volume property. This specifies whether or not the space that the Volume is defining is supposed to be occupied by water or a water-based liquid. For example, this could be used in Blueprints to specify that anytime the character is within a “water” volume, the character should begin to swim.

Summary

In this chapter, you got an in-depth look at several types of Actors available in UE4. In the next chapter, you will learn how to script logic for your game using Unreal Engine’s visual scripting system, Blueprints.