How do I make an HP bar appear for other players in Multiplayer?

You could add a variable in your HP widget, that is instance editable and exposed on spawn, and the type is that of your base pawn class.

Then in your pawn BP, you could have your widget component have no widget, and on Begin Play of your pawn, you can create a new HP bar widget, and pass a reference to self as the value for the variable that you created above. Then after you create it you can use the Set Widget function to set the HP as the widget of the widget component.

Then in your HP bar widget BP, on Construct, you can create a binding for the percent of your progress bar (I’m guessing you’re using a progress bar for the health), and set the percentage using the values you get from the variable.

If you are calling an event dispatcher on your pawn when health is changed, you could also just bind an event to that in your HP bar BP, so that the binding doesn’t run every frame, but only when health is changed.

340450-screenshot-2021-06-02-013153.png

![alt text][3]

1 Like