Hey, I’m looking for a way how I can make my stamina bar appear with instant-like Alpha Fade In effect whenever I’m Running, and make it Fade Out in the same manner once the bar fills up after a while. Render Opacity in Behaviour has no Bind option, so is there any workaround for that?
you can animate opacity on the animation graph.
just google “unreal UMG animation” and you’ll find lots of examples
Found only deprecated examples that aren’t involving my case.
Even tried with Custom Events attached to Play Animation (Target is Widget), with Variables As Animations, but that only made the Stamina Bar disappear.
"Accessed none trying to read property “As BP Player UI Stamina Widget”
Only deprecated Examples? I typed “Unreal UMG Animation” into YT Search and found tons of Videos, that work well, even in UE 5.1…
But… ok…
It depends on how you handle the UI and the running part.
Since you want an “instant” change… which sounds like making visible/collapsed within one frame…
You could add an event/function to your Stamina Widget, that has a bool as Input Parameter.
Whenever you press the running key, you call this event of the UI and set the bool to true, if you release the key, call the event and set it to false.
Inside the event, just use a branch to check the booleans input and set visibility of the whole Stamina Bar.
(Note: For Visibility… if you don’t need Mouse Hover/Enter/Leave/Move for a widget, use “Non Hit-Testable” as visible state. Cause the normal “Visible” state can cause problems with mouse interactions and consumption of those.
If you want a fade effect (which is NOT instant), you need animations for that.
Made a short Video:
YT - Animate Stamina Fade in/out with a function
Again… when hitting the running button, call the function with true. when releasing, call it with false.