I am trying to create a health bar,but every time I play the game the warning pops up about the construction script (the screenshot below).Also it also said the node in the other screenshot was a problem. Does anyone know how to fix it ?
This is basically a null pointer. That means that the UMG blueprint doesnt know that the OwningKnight variable exists. Are you doing an EventBeginPlay with a cast to the OwningKnight’s BP (Cast after ‘GetPlayerCharacter’ if the OwningKnight is the player defined ithe GameMode) and promoting that cast to the OwningKnight variable in the Widget’s BP?
I restarted the computer and that problems gone,but now the main problem is the node in the second picture link.
Can you post a picture of your construction script and the node that is giving the problem? You can click the highlighted text in your message log to jump to the code causing the issue.
The construction Script is on the first picture link after the screenshot.(Unless I have posted it wrong,I can see it from my computer).
Unitrix is right. Its a Null. use the “Get all actors of class” and “get”. This will link the vars so they know whats going on.
Make sure you choose the correct blueprint.