I’ve just learnt how to let a player character crouch. It’s a little complicated so I thought I’d take some notes in the intricacies. All credit for this goes to Mathew Wadstein and his excellent video tutorial. I’ll explain how to implement the whole process using an interface call, and I’ll show how we can …
Blueprints can get so disorganised over time: the more nodes we add to our Event Graph, the more cluttered and difficult to navigate the screen can get. While there is a way to search for an event across the current class, and there’s the option to split graphs into Functions, there’s also a way to …
I’ve been following EPIC’s Behaviour Tree Quick Start guide and delved into the fascinating world of Blackboards and Behaviour Trees (regardless of the missing u). I thought this way of implementing random walk actions in background characters would come in handy for making the game world come alive. In their example, the behaviour tree is …
I’ve been experimenting with AI Controllers and my Unreal Guys walking towards random locations in the game world. As such I needed a way for them to turn smoothly towards said random locations before they starting to walk. Thankfully I found out about the Find Look At Rotation node. It was exactly the missing piece …
Auto-fire means that you can keep holding down a button and a gun in your game keeps firing bullets at a pre-determined rate. No matter how a single-fire mechanism is setup, we can modify it to work automatically. In this article I’ll show you how it works. For this example I’m using the First Person …
Unreal Guy looks grey by default. He’s made up of two material zones, a rather complex one for his body and another one for his UE4 Logo. If you want to make him look a little different without creating a brand new material, we can override the default value for his Body material like this: …
If our AI controlled foes might chase us a little bit too fast, there’s a way to slow them down or speed them up. The value we need to set is called Max Walk Speed. To get access to this node, start by getting a reference to Character Movement. Then drag off that to get …
Did you know there’s a way to specify an Actor object by something other than an a reference? I thought this was a handy trick. iOS has a similar “hack”, and it can save your bacon on occasion. Tagging an Actor in Blueprint In the Class Defaults of your actor object, head over to Actor …
With spawned objects like bullets and projectiles, there’s a danger of creating a memory leak in our projects. This can happen when things are instantiated and added to the game world, but are never removed. Imagine creating a plethora of flying bullets that are only needed for a moment, but when not removed, they’ll keep …
In this article I’ll show you how we can keep a specific number of actors in the game world, and “replenish them” should they be removed. Imagine a game in which you pick flowers, and over time said flowers automatically re-grow but never exceed 10. Or a game in which the player battles against 5 …
Unreal Engine can make pawns to things, like chase down and follow the player. This is known as AI behaviour, for Artificial Intelligence. It works surprisingly well! Here’s how to set it up – in its simplest form. In principle we have to create an AI controller add the AI controller to the pawn define …
I know how to get an element by its index from an array in C, but I had no idea how this simple feat would work in Unreal Engine Blueprints. Turns out it’s a simple Get Node, however drawing it out and finding it is not so simple. Consider this code, which takes the first …
Interfaces are a C thing. They’re a set of functions that one class can implement so that an action is performed on another class of a potentially different type. Rather than calling a function explicitly on another class, we’re sending a message. If the receiving class knows what to do with it, it’ll react. If …
The beauty of Unreal Engine’s node system is that it’s relatively easy to extend your application code visually. At the same time, this can lead to extremely messy code (literally spaghetti code, considering the amount of noodles on the screen). While such code may be working in the heat of the moment, your future self …
I’ve been playing with another type of menu, namely the Generic Radial Menus v2.0 by PolyHavoc (available from the Unreal Marketplace). I picked it up as a freebie when it was on offer, but the current $14.99 asking price is certainly a good deal – considering I’d have no idea where to begin writing this …
I wanted to implement a scrolling selection menu in Unreal Engine, inspired by the one I’ve seen in The Flame in the Flood. It looked a tad complicated to begin with, but I’ve put I did some digging and found a way that works great. This can be combined with my previous article about Gamepad …
In this article I’ll explain how to add gamepad and keyboard navigation to UI Widgets in Unreal Engine. To my surprise, gamepad navigation magically works alongside regular mouse navigation, as long as Keyboard Focus is set appropriately on any of our UI elements. We don’t need to add any special logic to our project. All …
I just solved a puzzle that appeared so simple at first: I wanted to replace an image that was a child of a button in a UI widget in Unreal Engine. I had set it in the UI Designer just fine, simply picked it from the drop-down menu as an initial value, but then wanted …
When we begin a new Unreal Engine project, it’ll always ask us if we’d like to add the Starter Content pack. I was recently working on something and thought, “had I only said YES when I created this”, but alas I did not – and was without the Starter Content. Of course it can be …
I’ve just learnt how to update a counter variable in Unreal Engine. There are several steps to it and some prerequisites, namely: we need to have a variable to read out we need a text field to be updated we need to bind the text field to the variable we need a widget and add …
Something that wasn’t immediately obvious to me is that Unreal Engine saves its own file format under the hood. For example, a prop or audio file is not stored as .OBJ or .WAV, but as .UASSET file. Perhaps it’s just a wrapper that stores binary data, or maybe it’s some other kind of magic. Be …
I’ve just learnt about a nifty mechanism to change parameters on a material node in Unreal Engine. The niftyness lies in the fact that when we convert static values in the material editor into parameters, which then become the equivalent of public variables that are accessible from other parts of UE4. It sounds way scarier than it is, let me show you how it works in detail.
There’s a slightly weird terminology I keep hearing in various 3D applications. Those terms are Yaw, Pitch and Roll. I have trouble remembering which one is which, and which one is related to what axis in 3D space. I’m more used to the Euler notation system, and the only one I can remember is “roll” …
I’ve always been marvelling at all the little moving background items in video games. Most trees, grass, plants and such foliage appears to move subtly. How do they do that? Perhaps it’s a wind node? Surely that’ll eat up huge amounts of resources.
I just found a computationally cheaper trick to do this, namely by adding this effect to the plant’s material, thanks to a video by MetalGameStudios. It suggests that we can do this in two ways, both of which are described below. In either case, open the material of your object to proceed.
The EPIC Games launcher is a really handy tool from anything to add content into your projects or to browse marketplace assets. It has this annoying habit of closing automatically when Unreal Engine or a game of your choice is running. This might be fine for gamers, but I find myself frequently re-opening it once …
I’ve just figured out how to setup keyframe animations in Unreal Engine, and thought I’d make a note of it before I forget. I made the animation above a little while ago by “poking around”, but it wasn’t as smooth as I liked it to be. I think I’ve found the missing bits now, so here’s how it works. From what I gather, Unreal Engine calls Keyframe Animations “Cinematics”. They’re a little tricky to setup, because the whole engine is built for so much more, but in principle we need to:
create a new Level Sequence
create a Cinematic Camera
add the camera as a Track to the Sequencer
create keyframes for/with the camera
add a Camera Cut Track
export your animation as a video or image series
I’m going to create a camera animation like in the demo above, but any regular mesh object and Actor can be animated, including lights and their properties, so this process is not limited to cameras. However you need at least one camera to render out the sequence, at least that’s my goal here. The process will be different if you’d like to trigger the sequence from within a game, which is not in the scope of this article.
Following on from my earlier article about referencing a Blueprint from another Blueprint, Unreal Engine has another interesting way for inter-object communication. Sometimes we need to reference more than one object, say when press a button and want several objects to react, all in their own different way. Imagine pressing a button and a light goes off, a particle effect gets triggered and several enemies get spawned. Event Dispatchers can do that, and here’s how we can use them.
In this example I’ll have a Switch object, and a Lamp object. When we press the switch, it’ll send out a message to which the Lamp (and other objects) can react. Each object can implement the function and execute different code. I’ll only show the abstracted Lamp code here for brevity, from which I’m sure you’ll understand the gist.
Sadly the terminology “dispatcher” is a little confusing. At least to me, it suggests that an event is dispatched (i.e. sent), whereas in reality the dispatcher is actually the listener rather than the sender. Hence the dispatcher needs to be setup on the event that needs to react. A real-world dispatch worker doesn’t work that way (thanks code people for confusing us non-coders).
Imagine we had a Lamp object in our scene, and a Switch we can flick so that it turns on. Both objects are instances of a Blueprint, so the switch needs to know which lamp we’re talking about. Although it seems obvious to us as humans (or to our 3D player), this situation isn’t as …
I’ve recently had to use a helper object in Unreal Engine (a plane), but I didn’t want this object to be seen when the game was running. In a regular 3D application I would have just clicked that little eyeball icon to hide it, but that would temporarily remove the object from my scene in …
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 …