Tag Archives: Unreal Engine

Creating a Moving Platform in Unreal Engine

I’ve made a simple moving platform in Unreal Engine today. This is used in platform games all the time, be it as a triggered mechanism or an automatically moving always-looping/moving thing. Remember all those gaps you need to cross over a deep ravine, while stone platforms are moving left and right, and you’ll have to jump over them and make sure you don’t die? Yeah, those are the ones. I’ll show you how to make one of these in Blueprint.

With a new Actor Blueprint, I’ll add any type of object that will serve as my moving platform. A squashed cube will do, or anything more fancy if you wish. I found the platform above in the Synty Sci-Fi City Assets. It needs to be movable rather than static, otherwise Unreal Engine will throw an error message as it’s trying to animate it.

In the Event Editor, I’ll hook into Event BeginPlay for an always-moving platform. It’ll be different for a platform that is triggered as a result of a player’s action. Any trigger will do to kick off the yellow Timeline Node. I’ve called mine Elevator, and here’s how it’s hooked up:

The Height parameter drives the Z Location of our platform (referenced as Target). The real magic is happening inside the Timeline Node though, so let’s have a look at that:

Here we have a vector track I’ve named Height. It’ll be accessible as a pin on the node, as seen in the previous screenshot. There are five keyframes on this track (creatable by right-clicking), interpolating the output value between 0 and 800, and leaving a plateau at the top and bottom so the platform waits for the player to step on/off.

The sequence will auto-play and loop indefinitely. Adjust as necessary. Here’s what it looks like in the game:

Any questions? Please let me know below!

How to play a short sound file in Unreal Engine

When something happens in our game, we may need to play a sound file. Think of anything from firing a bullet, playing footsteps during a walk, or a sound that is fired as a result of us sliding something open. To play those sorts of files we can use a method called Play Sound At Location. Let me show you how it works.

We need several things to make it happen:

  • a sound file, imported into our project (in WAV format)
  • the world location of where we’d like to play our sound
  • a trigger (any event will do)

Here’s what this looks like in Blueprint:

In this example I’m playing a sound file called Door_Movement. It is triggered by a Do Once node, but any trigger will do. Do Once is nice because it avoids your file being played 60 times a second which is… annoying.

The Play Sound at Location node needs to know where to play the sound, and in my case I’m playing it where my Trigger Volume is located (which is likely where my player is located to hear the sound, having just stepped into said Trigger Volume). To get this location, I need a reference to the object, and a GetWorldLocation node. That’s it!

There are some exciting items on the Play Sound node, like the pitch and volume controls. I’ve used an interesting effect in a Game Maker project once, where the “dying” sound an enemy makes is randomly pitched a tad higher or lower than the basic sound, adding a little variation into a single sound file.

Building a Sliding Door in Unreal Engine

I’ve been following Katie’s videos to get my feet wet with Unreal Engine, and thought I’d take a note on how to build her sliding door so I don’t forget. Here’s how I’ve built mine in principle:

  • create a new Blueprint Actor
  • bring in a cube and build an “InnerDoor” piece (that’s the one that will slide up and down)
  • build a frame for the door (will remain static)
  • add a Box Collision and extend it (it will trigger our animation)
  • use a Timeline node to raise the door
  • reverse the process so the door closes

I’m doing it slightly different to how Katie suggests it, but there’s really no right or wrong way. Let’s get started!

Continue reading Building a Sliding Door in Unreal Engine

How to make objects rotate indefinitely in Unreal Engine

I bought the Synty Farm Asset pack recently. The demo level looks great, except for the fact that the windmills dotted around the farm are not rotating. This looks a little bit out of place with the rest of the animated scene. Being the newbie that I am, I was wondering how I could make the mills turn, and thankfully I’ve found a solution. Let me share it with you here.

The first thing we need is an AddActorLocalRotation node. Type “rotation” in the search field and you’ll see a huge variety of nodes popping up. Some others will work, however in my experiments, the ones suggested by other sources did not rotate my object 360 degrees (let alone indefinitely). AddActorLocalRotation seems to do the trick though.

Next, drag off the Delta Rotation parameter and add a Make Rotator node. This will let us choose around which axis the object needs to be rotated. Thankfully we’re getting XYZ values in addition to the more “proper” values which sadly mean nothing to me. From the object in my viewport I can tell that I need the Y (Pitch) value. The simplest way to make this thing spin is to hack in a value here manually.

A more elegant way would be to promote our desired input to a float variable. The advantage is that we can now set the value from outside the Event Graph, and without having to re-compile the Blueprint if we want to make a change to the rotational speed.

Click Simulate to see the effect in the viewport, or play the level with your Blueprint actor in the scene.

Changing Morph Targets programmatically in Unreal Engine

I’ve just found out how to change values for Morph Targets on objects in Unreal Engine via code. This will come in handy when any attribute needs to be updated either as a result of user input, or via automation. Here’s the basic workflow:

  • know the exact name of the Morph Target
  • add a Set Morph Target node in Blueprints
  • populate it with the name of the morph
  • give it a value (between 0 and 1, equivalent to 0% to 100%)

Here’s a small example that continuously changes my Genesis 8 character from Basic Female into Olympia. While not particularly useful in itself, it illustrates how a parameter change can trigger a morph.

Continue reading Changing Morph Targets programmatically in Unreal Engine

How to get rid of the white ball in Unreal Blueprints

When you start a new Blueprint Class in Unreal Engine, there’s this weird white ball that shows up in the centre of the viewport. I believe it represents the Default Root object. Trouble is, there’s no obvious way to get rid of it, even when you add a mesh object to your Blueprint. For a troubled and easily confused beginner like myself, I don’t even know what question to type into Google to get an approximate answer.

In this article I’ll show you the simple solution to the problem. Here’s the ball I’m referring to:

Even with a Static Mesh in my scene, that ball persist. I can’t even select it.

Continue reading How to get rid of the white ball in Unreal Blueprints

How to setup Dead Zones for Game Pads in Unreal Engine

My old Xbox 360 controller has been in use for nearly 10 years, but it’s still going strong while suffering from very sensitive Dead Zones. Those are the areas around the untouched centre position of a game pad that can sometimes deliver erratic results, especially after years of use (although I’ve seen brand new ones suffering from the same phenomenon).

Unreal Engine lets you define the dead zones for a project, and I just found out how to do it. It’s a project wide setting that can be found under Edit – Project Settings – Input. There’s a big section called Bindings at the very top of this huge list, at the bottom of which is a small “advanced” triangle. It’ll open even more options. Scary indeed! However, this is where we find Axis Config, as well as sections for each Game Pad Axis. Open each axis to reveal a Dead Zone property.

The default is set to 0.25, which is very generous and works perfectly in most cases, yet at the same time can feel a little rough and abrupt at times. Don’t set it to 0 (that’ll be terrible and lead to drifting), but anything from 0.05 upwards might give good results. Try it out and see if it helps game pad improvements.

How to tweak automatic exposure control in Unreal Engine

There’s a feature in most game engines that adjust the exposure automatically as we walk through a scene. When we look at the sky it makes sure the highlights aren’t clipped, and when we walk into a dark cavern it brightens up the shadows for us dynamically.

In Unreal Engine, this object is called the Post Process Volume. It comes up as a Visual Effect in the Modes Panel. Some demo scenes have enabled already, in which case take a peek in the World Outliner.

To adjust how much this exposure adjustment takes place, select the object in your scene and take a look at its Lens properties.

The Min and Max Brightness values let you pick how much compensation should be applied, while the Speed Up and Down let you adjust how fast either compensation should happen.

Further Reading

Animating Synty Characters in Unreal Engine

I’ve been intrigued by how easy it is to render a scene from Synty Studios in Unreal Engine. It’s as easy as opening the project and selecting the demo map. This allows us to explore the scene with the default Unreal Mannequin.

I wanted to find out how to use a Synty character in its place, and it looks like I’ve found out how to do this. These are my case notes, based on a video by BeefaloBart. He’s using the Heist Pack, while I’m going to try my luck with the Polygon City scene and condensed his instructions.

Let’s do this!

Continue reading Animating Synty Characters in Unreal Engine

My first 24 Hours with the Unreal Engine

In my quest to take a look behind the scenes of how game engines work, I’ve decided to take a closer look at the Unreal Engine, more specifically UE 4.22.3. I had installed it a few weeks ago but other than launch a template or two, I didn’t do anything else with it. After my recent deep dive into Unity, I thought this would make for a nice comparison writeup.

Here’s how I experienced the first 24 hours with Unreal. I’ve even added a video at the end to show you a level that I’ve built. For this review I’ve been following this tutorial series by Paul Kind. He’s a wonderful teacher!

Continue reading My first 24 Hours with the Unreal Engine