Unreal Engine: Slate HUD

For Sky Noon, as we had switched over to mostly C++ for our programming implementation, using Slate for our User Interface and HUD was a more viable option. Slate is a powerful framework for providing developers with programmable HUD and User Interface, and helped us start fresh from the UMG Widget replication issues we had in our Prototype.

What we weren’t prepared for was the lack of documentation surrounding the Slate Framework for Unreal Engine. Thankfully, with some help from the Content Examples, we were able to look through the code and see how things were built, and have quickly whipped up this Overview of how we were able to create our own HUD with Curve animations.

We wanted to give more Feedback to the player in every aspect, which included the HUD. The most important addition was movement. You can see in the gif below, when the player lands on the ground after being airborne, the HUD jolts, giving players impact that will eventually be supported with Arm Animations.

HUD Animation
HUD Animation

Here is how it was done, if you are interested:

HUDVariables

These Variables are added in the HUD Widget.

 

HUDWidget

The Padding on this SOverlay above uses the Bound Function, from here:

HUDBinding

The function itself gives an FMargin Variable:

HUDFunction

The bottom Padding is altered based on the Curve Variable, which we set up in Construct:

HUDSetup

The Widget Animation is played when the Player hits the ground, so we wait for this change in the tick.

HUDTick

This is early implementation, but the logic is simple. Hopefully this helps with implementation of your own moving HUD.

Leave a Reply