Download

Using UI Materials with UMG

Sorry if this is a bit ranty, I’ve been having a lot of problems with UMG lately. I’ve been working with UMG for almost a year now, and even after all this time it is still extremely frustrating to me. Right now, I’m trying to create a button using a UI-space material so that I can better control the animation of the button.

I’m approaching this as a web developer, so I tried creating an animation that is triggered when the button is hovered or focused by the mouse/controller. In practice, the button does not seem to follow any logic at all. It is usually unanimated when the game is launched, then might switch to a certain frame of animation on hover, then play the animation if focus is lost quickly enough. Then there’s a 50-50 chance of it playing a different animation after that.

In the past, using tutorials by Ryan Laley, I’ve created buttons that do not use the Normal/Hovered/Disabled states, but instead set those using a slate brush and then check what their state should be every single tick. I’m trying to simplify this process as much as possible, preferably by leaving tick out entirely, but so far I have not found a better way to do it.

TLDR;

  • Trying to use materials with UMG
  • Not working how any human would expect them to
  • plz help


^ This is the animation that should occur on hover


^ What it actually does. This thing that the mouse is hovering on is not actually a button, because the button seemed to make things even more difficult, it is just a widget that for all intents and purposes is a button. This is the best I’ve gotten it to work, but it still is fully visible when the mouse is not hovering (it shouldn’t be) and there’s still a lot of janky cuts between animations that shouldn’t occur.