UMG Documentation for 4.4 Preview

Ok, assuming all that other code runs, and it’s just the percent that fails to be set, try doing it without the Delay node, there’s an I just tracked down today with widgets and sub widgets and latent nodes (Delay…etc).

Also I tried your asset, had to strip out all the things I don’t have the code for, but pressing the button results in the progress bar being set to 20% for me now, all i did was skip the delay node and go directly to setting the progress.

If widget is hosted inside of another widget, that could also be the cause. There was a nasty bug with sub widget initialization I fixed today.

Hmm…

Does the percent get reset after you release the button? That’s happening to me.

Nope, try simplifying your test case, don’t do anything except update the progress. Are you doing anything else, like creating a new widget multiple times, that’s some how replacing the old UI?

I have my draw widget call inside the HUD blueprint with event draw HUD. I interchange between 3 Huds. I turn off one using hide and show another.

Edit:

I’m using method and the bar keeps getting reset everytime I release the button for some reason. Default value is 0. If I press the button the bar changes to 0.2 2/10 filled then once I release the button it gets reset to 0.

The entire game pauses whenever I hit the button. That could be the problem?

Nah, that’s throttling the editor does when certain slate actions are taken. Needs to be fixed for UMG; won’t happen in a standalone or cooked player.

The is more than likely the code that’s interchanging between 3 HUDs, it’s probably resetting the UI by spawning a new viewport widget.

I’m making an rts and I’m trying to have different UI for every unit. I have to ask. Would you create the UI inside the HUD blueprint, or would you do it somewhere else like the Level blueprint? In 4.3 I had a problem when creating a widget anyone except the Draw Hud event. I’m not sure if I tried it somewhere else it’ll work or not… I’ll go try it now and edit with results.

Edit: It works, but it’s really buggy. That’s why I’ve been using the Draw Hud event to create the widgets and remove them.

The canvas based HUD system and UMG don’t share anything and they’re very different creatures. UMG widgets are more like Actors, you create the widget and you keep it around. I’ve done it using the level blueprint, but more than likely you’ll want to put it on a derivative of the PlayerController. You don’t need to tell the UMG widgets to paint either, after they’ve been created, just add them to the viewport and you’re done, they’ll take care of drawing themselves.

So for an RTS, you’d probably keep the actively selected UI around, and just only add and remove the Widgets when selection changes for the current units.

You were right. My draw hud event was spawning widgets on top of each other which caused the progress bar to appear empty even if I changed it. I used do once event and now it’s working. Thanks!

no response :frowning:

You said you were going to keep digging, so I figured I’d let you dig :slight_smile: Hit the [Auto Key] button then move the time slider to where to start the keyframe, probably just leave it at 0, then adjust some properties to keyframe. Not everything can be keyframed yet, just properties with the keyframe icon beside them. All edits have to be made in the property grid in order for sequencer to see the change currently.

I hope you all the best . Really good job with the UMG. I was about to start learning Unreal Engine C++, but thank god I found :stuck_out_tongue:

One bit of functionality I’d expect to see but am not is the ability to dynamically position elements over time. Is that something I’m missing, or is it not implemented or on the road map?

Examples I’m thinking of:

  • sliding an element on screen once it’s activated
  • placing an objective marker on a location in the world
  • putting a use prompt over a usable object

Looks good overall, thanks

,

Is there anyway to keep the mouse X/Y inputs and still get the screen lock from UMG? I want to rotate my screen, but still keep the HUDs and the mouse within the game viewport. Without UMG the mouse leaves the view port.

,

I am trying to use the viewport. After adding the widget in the player controller, I then try to spawn items in the viewport. No matter what I do (move the camera position, move the actors around, add a direction light) all I see the the background color. Is there a simple example you can provide to get something rendered in the viewport?

Thanks!

I have a quick question: will UMG be c++ enabled too?

e.g. will c++ be able to call upon the umg or slate file(whatever it is), and traverse the ui, find and bind the buttons? That’s how it worked coming from C4Engine, and I thought that it was a great way of creating a UI.

If not, how will the new UMG editor go along with c++? I’m new to the unreal ui system, so pardon if the answer is already known/obvious.

will probably elaborate, but I think UMG is based on slate which is based on C++. Before, you had either HUD canvas or slate to make UI. Slate was C++. Now you can use UMG which uses slate to give you something you can work with blueprints.

That is theoretically possible, but I would only use it for low level stuff like creating new UWidgets. My intended use-case is, the hardcore work is done by a C++ gameplay programmer and they just expose a Blueprint Function called Play…etc, and the UI designer just hookups the play button to call play, instead of the C++ programmer trying to guess names of widgets to bind actions to.

,

Please help!

I have yet to understand what bind to function is supposed to do. Can’t I just have an event for whenever the button is pressed down? Can I make my function an event? It only gives me get which I can’t really understand when I pull the function into my event graph.

Binding a function is analogous to making a delegate in C++. It’s like a blueprint event, but it’s different because it can’t be deferred or executed over multiple frames, the system must call the function and resolve it instantly because it needs the return value of the function. You can’t make a function an event. I’ve changed the button click to a multicast blueprint event in Main Line, but you wont have it until the next major version in a binary build (4.5).

You can’t make the function an event, but you can have a function call an event. The Get is a bug, the binding code that creates the function blueprint is making it a pure function, which means it has no side , you’ll want to change that to a non-pure function by unchecking the box, that will allow it to be executable by other blueprint code.