Make sure you set the Owning Player field to a reference in the Create Widget function.
Since you are in a player controller blueprint use the self variable (it should come up if you drag off it as an option)
Make sure you set the Owning Player field to a reference in the Create Widget function.
Since you are in a player controller blueprint use the self variable (it should come up if you drag off it as an option)
Hi, I’m trying to use UMG with the new 4.5 version of Unreal Engine but I don’t get how UMG works now.
I’ve used UMG a bit in the previous version 4.4.3 and it worked there but when I updated to 4.5 I cant make anything show up on screen.
I have made a widget: MainMenu and in the player controller i have the following blueprint:
https://cdn.mediacru.sh/LsBKlbiADUQY.png
It prints “Hello” on the screen but I cant see the widget.
Thanks in advance.
I tried adding it but its still not working.
https://cdn.mediacru.sh/hJsJfvciHg4L.png
This is what the widget looks like, but it’s still not showing
Can you show an image of your blueprint?
Sure, here is the blueprint I’m using at the moment (not working):
https://cdn.mediacru.sh/E0wuThPU2QxF.png
This is inside my player controller. I tried to add “set visibility” but then the engine crashes when I click “O”.
This is a project that I updated from 4.4.3
Hmm, can you post a copy of the asset somewhere I can take a look?
Also if you hit Ctrl+Shift+W in the editor you can summon the widget reflector. You can use it to ‘pick’ on the widgets on the viewport to see if your particular widgets were added. It will display all the info in terms of slate widgets, but it can be helpful.
I tried the Ctrl+Shift+W and clicked on the game viewport when playing the game in “new editor window” and the engine crashed.
How do I upload a copy of the asset? Which asset would you want, the player controller or the widget? I havnt really done anything in the widget and the code for the player controller doesnt have anything more that is related to the widgets, only a custom respawn and tick event
The widget’s uasset file. Tried reproducing your case, but the widget came up just fine. Try doing the widget reflector on the regular viewport, and just start the game there. What happens if you try to show a new widget, instead of your old widget?
Ok, I tried to make a new widget and it worked. Although I had to make a new “Create widget” in the blueprint as the old one gave me an error.
Here is a link to the uasset for the old widget.
Thanks for taking the time to help me
Well I found the problem, you some how convinced the editor to allow you to bind a non-pure, non-text returning function to the Text property of the button’s text widget. So when it was evaluated (and by some miracle worked), but then the function removes the widget from the viewport during what is supposed to be a function with no side effects. So it caused all manner of weird and strange problems inside the internals of Slate. Instead of a blank screen I got a crash in the middle of a slate pre-pass with no apparent cause.
I think I need to add some more checks…
Cheers,
Nick
Oh wow, I guess I must have added that and then forgot about it. Thanks again for all your help