I have just started working with blueprints and am following the Welcome to Game Development Series from the UE4 Learning section.
I made it all the way to the Widget Blueprint Introduction video and hit a wall. In short I am unable to call the the Update health bar event from the Widget Graph in the FPS Character blueprint. I made doubly sure that I promoted the return value of the “create widget” as a variable but I cant seem to call the custom event I made in the Widget graph.
I have attached images of the Widget Graph and the FPS character blueprint if anyone can give any insight that would be great.
in the create widget node plug the “get player controller” node to the owning player in.
in the widget function, remember that the percent want values between 0 and 1, not 0 and 100, so you need to divide your health by 100 ( or by your max health value) first.
and of course if you want to call that function inside the widget do it draging the node from your variable.
Thanks for the help! Unfortunately, I still can’t call my Custom Event “Update Health” from the Variable I made from the create widget node. I type it into the search bar and and looked in the call drop down menu and no dice.
providing the widget reference was created by promotion after the class was chosen on the Create Widget node, you should have a reference of the correct type (doble check the type of that var)
I type it into the search bar and and
looked in the call drop down menu and
no dice.
calling the custom event would be matter of dragging a wire from that ref var and searching for the custom event’s name
You’ve called both the custom event and the widget reference Update Health - so that is probably adding to the confusion.