So I am using a dictionary to store all my stats into one file to keep track of everything easily.
Now I am trying to create a block where when you enter it, it deals damage to the player, updating the dictionary script. So far this works perfectly, however, for some reason I cant get my healthbar UI to update. I have a script attached to the "damage block" as I when I deal damage, I want it to come from the area rather than having to code it in the normal player script or in the UI script.
Currently I am using the get_node() function and it seems to be working correctly as it prints out that new value, but the UI is not updating with this new value. If I code the damage event within the UI script it works fine, but as I said above, I dont want to end up with having to code every single damage hit from every object or enemy into the UI script.
Is there anyway to update the UI script from the "damage block" script? Or am I stuck having to code it into the UI script?
Any help will be much appriciated!