I followed the tutorial on the unreal wiki to create the basic Health, Energy, and Mood (XP in my case), but I can’t seem to get the progress bars updating.
After making the basic game HUD, I bound the progress bars to the correct variables within my character:
I’m trying to make the basic; “When he jumps, remove 20 energy”. I made this within the FirstPersonCharacter Blueprint:
But the progress bar is not changing.
Other than that, whenever I pick up an item within my game world, I wish for the user to gain XP.
Are those energy XP amd xp till next level Float by any chance? If so watch this: https://www.youtube.com/watch?v=PZRI1IfStY0
That is hint for the future, be careful with float and == operator. Use rather “nearly equal”.
So first change i propose is to change that “==” with “compare float” node.
Are you actually casting and sending that variable value over to HUD (or updating this variable in hud from player pawn)?
You also should place that print node in various places, track whole chain of events and see where it stops. Instead of printing some bad words you should print value of those variables.
And when we are at subject of “censored” words, you really should edit that picture and remove it. This may be seen as avoiding world filter, which is 2 infraction points.
Easiest way to update variables:
in progress bar inside that bind function that updates bar value.
Add there get player pawn (or controller depends where you keep XP variable)
Then cast to "your name pf player controller (or pawn) class.
And type “XP” m then create “GET XP” node.
Now you have value of “XP” variable right from controller.
Create variable in umg blueprint, and store that value there (you may want to use it in more places of umg later)
Now you should have bar updated.
And some tips:
bars operate in range of 0.0 to 1.0 (not 0 to 100%).
there is great node that is called “Map in range”
Also future hint: “Format text” it is great node for all numerical text output, together with “integer” or “float” to “text” converting nodes. You can easily format all your numbers.
You also should start looking into “blueprint communication”, it is quite easy thing to use, but very messy to learn at first. Do not get frustrated give it time.
I have two progress bars that are in the 0-100% range. The third which was created at the same time but not set up is stuck in 0-1.0 range. Deleting and recreating it I only get 0-1.0 range.
I can copy paste a 100% range bar, but if I change the range slider it pops into 1.0 range.
hmm, got it to work, I did something dumb. Either way, I can use 100 and the 1.0-0 still works as 100%, still don’t know why two bars are one way and this one isn’t.