Event Construction Not Firing

Hi! This is my first time using the answers website of unreal engine so please be kind lol. Here’s my question, I have a widget that shows my basic health bar in the designer tab and my blueprint for said widget in the graph tab.

As you can see, the Event Construct is connected to the Create Widget which is then connected to Add to Viewport. When I press play, the Event Construct will not fire. I’ve tried looking for the Event BeginPlay too but I can’t find it.
If you can figure out why the event construct is not working, I will be very happy! :smiley:
Thanks in advanced!

First Welcome to AnswerHub, we always promise to be nice. UE4 user got to stick together. Begin play would be the best place to create the widget. All you are missing is a ‘Get Player Controller’ node that plugs into the Owning Player pin.

Event Construct is only called when the widget is created. If this widget isn’t being created by something else, then this code won’t execute.

Widgets can’t execute BeginPlay because they never exist in a level when BeginPlay happens.

I suggest, you add this code to your custom GameMode’s BeginPlay, or create a custom HUD object to manage this.

I’ve tried adding this FirstPersonCharacter blue print but in the blueprint. Also, where is the “GameMode”?

Sorry, meant to say that in the blue print it does not show “add to viewport”

If you want to put this code in your FirstPersonCharacter, copy exactly what you have above, and put it on the BeginPlay event.

Hi all! I have figured out a solution to this problem. I needed to create a HUD interface so I can then have the begin play option because the Widget blueprint does not have that event. Also, thanks to @ipninichuck for the “other character” problem. But thank you all for helping :slight_smile:

BenVlodgi is correct…sorry…got ahead of myself. You need to create the widget in a separate object such as the GameMode.

Add to Viewport should show up if you drag from the output pin of ‘create widget’ node and then right click and select it from the drop down menu. The game mode blueprint can be found in your FirstPersonBP folder in your particular case. You can also make your own and change to your custom game mode in your project settings under the tab ‘maps and modes’.

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/SettingUpAGameMode/Blueprints/