Hey, I have been struggling with this for a few days.
So I have an enemy blueprint to which I added a widget component, and selected my EnemyHealth widget blueprint as a class.
My max health variable is stored in a map within a data table row. Maybe this is causing some problems?
Within the widget blueprint I look for this max and current health then return them like this:
Here the progress bar is bind to this function. I tried many other ways. Creating a separate variable for health percentage, updating it and that didn’t change anything.
Do you have any ideas?
note: I am using the free jRPG template from the Unreal Marketplace
Have you try locating where the error may be?
What happens if you use inject a float value directly into the return node?
What happens if you use inject a float value directly into the division node (first in the numerator, then in the denominator)?
Seems like the error comes from Get Data Table Row DT_jRPG_Enemies, when I inject floats into the return or division node it is displays the correct value. I am new to Unreal Engine and can’t figure out what is wrong with Getting the Data Table row.
edit: I am getting an accessed none error for Get Data Table Row
This is AC JRPG Character stats component it is inherited by all characters, I try to use this to access a characters name which is used to find a row in the Data Table:
I don’t see how you’re setting the “BP Enemy Base” value in the widget. The problem is not with the table but with that reference.
In the Enemy Base, you must set that variable.
Here is an example:
Consider the “Owner” var as the your “BP Enemy Base” var in the widget:
It managed to get it done!
Thank you for everyone who replied. I am not exactly sure what the problem was. I basically restarted from the beginning, created widget component, and then the blueprint and now it works as intended. I followed @EvilCleric’s instructions. I might have made a mistake somewhere and did not notice it!