I’m setting the percent health on AI actors by passing their health percentage to their widget progress bar. I’m getting a weird issue with fill. I’m following the same logic I’ve seen in other, working, implementations of this sort of thing, but because this is my first time implementing something like this, I might be doing something wrong.
Here are pictures of all of the relevant views and screenshots of the specific issue.
If any additional information is needed, I would be happy to provide it.
Note: Unlike similar questions the issue is not due to out of range percentages. The print string statement on the screen shots shows that the widget is being given appropriate values.
I was unable to reproduce this issue that you described above with the information provided. However, I was able to achieve what I expect is your end goal. I have provided an example of this below. I was able to get the onscreen UI to update at the same frequency as that of the 3D widget. I hope that this helps.
I set up a custom event inside of the widget that I wanted to use. In this example it subtracts a set amount whenever the event is called.
This is my 3D widget Actor that is placed in the level. I have used the “Get User widget object” node to update the 3D widget Actor and I have used the Get all Widgets of Class Node with a for each loop update the widget that is in 2D screen space.
This doesn’t solve my issue and isn’t what I’m attempting to implement. Each of the AI actors should have individual health meters. I can provide more information for replication sake, but marking a bug report as resolved without further attempts to replicate it represents a gross oversight on your part.
Look at the print statement values, these values should be passed to the widget with the set percent node. The print statements wouldn’t appear if the cast to BotHealthBlueprint failed. Since the print statements appear, set percent should be a valid option. Setting values of 0.6, 0.8, 0.2 should fill the bar accordingly, but this is not happening. Hence the bug report.
I see that my previous answer was incorrect. I have a few question for you that will help narrow down what issue it is that you are experiencing.
What version of the engine are you using?
Can you reproduce this issue in a clean project?
If so, could you provide a detailed list of steps to reproduce this issue on our end?
Could you submit new screen shots with legible read outs of your print strings?
Could you elaborate on what exactly what the issue is as well as to what the expected result would be?
When you say that your AI should have individual health bars, could you clarify what you are seeing and how it is inverse to the expected result (Example are they all updating at the same time or is only one instance of your AI updating)?
Could you specify the blueprint that was used in your original post (Widget or AI bot or other)?
After specifying the blueprint class, could you then provide a screen shot of the blueprint that is call the custom event that is shown in the image provided?
After looking over you project I was able to find that your Widgets are being clipped off because the widget component was incorrectly sized. The calculations and updates are working correctly. If you change the size of your widget component to 600 along the X axis you will see what I mean. I have provided a picture as a reference. I hope this helps.