Can't set percent of progress bar when in player blueprint

I am trying to set the percent of a progress bar in my player blueprint but when i drag in the progress bar I get an error.

Hey @ArsenalStudios! Welcome to the forums!

Would you mind sharing your error? Additionally, is this blueprint on the progress bar?
If so, I suggest using blueprint interfaces to reference your progress bar instead of just a hit event.

Any additional information you provide may go a long way in solving your problem.

Is the progress bar inside a widget component? If it is not , show us how you add the widget to the viewport.

1 Like

Thanks! No, this blueprint is the player’s blueprint so when the player is hit I want the progress bar to set its percent to the players hit points. Answering to @Everynone yes it is in a widget component. Here is the code that adds it to the screen (inside the level blueprint)

You say it’s a widget component but what you show is not a widget component at all.

  • a Widget Component is a highly specialised Actor Component added to an actor like so:

This component creates an instance of a regular widget and maintains it, shows in screen space or world space.

  • if you’re creating a regular widget:

You’ve assigned the widget to a reference variable (Set New Var 0 in the top row), use it to access the widget. In the future, consider avoiding placing nodes on their own like you did with the progress bar - it’s counterintuitive and will throw errors often.

Blueprint wires are context sensitive, drag a wire first instead and then search - you’ll get filtered results that make sense in this very context; and wires will be automatically connected which saves you a click: