How to convert an Int to a Float for use with a UMG Progress Bar?
So in my player character I have an Int variable called PlayerHealth with a value of 100. I want to be able to use this with a UMG Progress Bar. How can I do this in Blueprint? Thanks.
asked Sep 26 '15 at 11:44 PM in Blueprint Scripting
In your UMG, select your ProgressBar and look for Percentage, it should have a binding next to it. Create a new binding. This is what should be in your binding:
So what this basically does is gets the pawn that you're controlling, converts it to whatever your player is (I used the basic ThirdPersonCharacter for this example), gets the Health variable, converts the int to a float (type 'to float' or just make the next node and plug it in and it will do it automatically for you), divides it by a float of 100.0, and then returns a percentage.
answered Sep 27 '15 at 12:13 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here