Creating a Jump Pad in Unreal Engine

I was recently playing the original Unreal Tournament again and realized that the game holds up pretty well even now, couple of decades after its release. I admit that nostalgia might partly be the culprit, but as soon as the intro scene started playing, hearing that voice and background score, it felt like getting into a time capsule back into the early 2000s. Booting up some levels, I was genuinely surprised by how atmospheric most of them felt.




The diverse background settings in which the matches took place along with the excellent soundtrack that accompanies them, seemed to create a sense of being in that virtual space that you don't often get in a lot of games. And one of those levels that has really stuck with me is the Capture the Flag map "CTF-LavaGiant", with its beautiful skyscape and the sea of lava surrounding the core game space. 


After loading it up for a quick game, I came across a pair of Jump Boots on the way back from the enemy base, which I then used to vault over the walls of their fort.


It was quite fun jumping over the lava to make my way back to our base. And then I figured why not try to make something similar in Unreal Engine. It's quite simple, but I had never tried any experiments with jumping mechanics. Besides, I rarely find challenge to be a deciding factor when it comes to motivation. It's almost always about the joy of just exploring new possibilities.

So the next day, after work, I went ahead and created a new UE4 project. Since I wanted to create a wall jumping mechanic as well (inspired by ULTRAKILL), I decided to go for a Jump Pad instead of Jump Boots for this project.

The basic set up was simple. Create an actor that has a collision volume, which when triggered by the player character, will push it in the upward direction. The Blink Ability project that I had worked on a year or two back, involved some logic that pushed the character over the wall to roughly simulate climbing after teleporting to a ledge above you.



And while I ended up using the "Move Component To" node in favor of the Launch Character node back then, here the latter seemed perfect. As soon as the Jump Pad collision box registers an overlap, it checks if the overlapping actor is a character type and if true, launches it in the upward direction.


However, after testing the Jump Pad a few times, I noticed that the jump heights weren't always the same. When the character walked up to the Jump Pad, I was able to jump much higher than when it was falling on to the Jump Pad. The issue was fixed by setting the ZOverride parameter on the node to True.


Basically what this does is ignore the Z component of the character's velocity and assign the launch velocity value to it. Now even if your character is falling down to the Jump Pad, the negative value of the fall velocity Z component is not taken into account when launching the character upwards. So I guess that is something new that I've learnt as part of this experiment. Anyways with taken care of, my character was jumping around the map quite fine.


And that's another experiment successfully completed. I also went ahead and recreated the Translocator from Unreal Tournament after this project. I want to try out the Shock Rifle at some point as well. But one thing at a time. Right now, I'm just glad to have started writing again after more than a year of hiatus. Hoping to keep this going.

Comments