Hello. First, I followed a video clip of C ++ on YouTube, connected to Progress Bar.
They said that the player’s index(Get Player Character) is only given to the player…
The monster’s HP also wanted to connect like this, so I don’t know what to add to it.
Just plug in the Cast To Monster before Get Current Health, so it won’t work …
How should I connect? Monster’s parents class is Character class.
And how do you use the Add Component - Widget in blue print?
most people will tell you to implement an interface. I personally find them confusing and hate using them in blueprints.
The first thing to do is, somewhere in youre enemy blueprint, you either have this as a component, or are creating it and adding it to the viewport. If the latter is the case, then right click on the blue return value from the create widget node and choose promote to variable. Call it something like MyHealthBar
After that, go to the widget blueprint for the health bar and add a new float variable called barFillAmount, make a new function called refresh bar, and make a new input for that refreshBar function called updatedHealth.