Adventures with Lava


By Sergoth aka Trevor Smith

Soooo... Adventures with Lava!

Adventures With Lava!

Prototype movement challenge room

Movement challenge room prototype

So today, my task was to create a prototype hazard  for movement challenges, and I went with one of the staples of the adventure genre, good ol' lava. Lets run through how we made it!

So first, I made a BP_Hazard_Template actor blueprint which just contained a static mesh as the root object. This is the class I'll use to call various hazard types during the procedural dungeon generation.

Next up, make my BP_Hazard_LavaPool, using the BP_Hazard_Template as the parent. So far so good. I've got a static mesh, but we need to give it that magmatic goodness.

Hopping over to the Unreal Marketplace, I grabbed the Infinity  Blade: Firelands Project, free from epic games, and migrate a nice lava material from it. Opening it up in the editor, I see it is rather bare bones, so I expose some variables as params to be able to edit them within my blueprints, specifically a texture scalar for tiling, FlowSpeed scalars for both X and  Y axes, and a scalar for the emissive brightness.

Lava MaterialAnd with that,  I now have access to and  the ability to control the look of the material from the main lava pool blueprint.

Next, time to make the lava damage the player!  Woohoo, looks like Epic has already provided us with a tool for that, the aptly named 'Pain Causing Volume'. Aptly named, for little did I know just how much pain this volume was going to cause me.

Alright, slap it in as a child actor, spend time exposing it's variables to the main blueprint so I can set them during construction... Hmmmm... the viewport isn't showing the volume as being... well, a volume. Just looks like a point in space, unlike when you drop one into  the world outliner. Whelp, I'll just try making it's relative transform equal to that of the  static mesh. That should work, right? ....RIGHT?

Spoiler alert, it did not work. And neither did a few dozen other things I tried. No matter what I did, I could not seem to get this volume to actually have some sort of area. I finally resorted to asking ChatGPT, but it just accused me of being an idiot, and swore up and down it should work.

An hour of Google-fu later, I finally came across some posts bemoaning the fact that volumes weren't supported inside of other blueprints.

....What? That can't be right... surely Epic wouldn't make an easy-to-use damage over time zone and then make it so it couldn't be used within a blueprint...

Nope, that's exactly what they did back in UE4, and it still hasn't been updated in UE5. 

Once I realized that, I wrote a simple logic gate loop utilizing the ActorBeginOverlap and ActorEndOverlap events. Took me about 3 minutes, and worked like a charm right off the bat.

DOT Logic

Sometimes you just gotta do it yourself

The lesson learned? Sometimes shortcuts aren't so short, so practice your KISS coding principles.

Leave a comment

Log in with itch.io to leave a comment.