Im trying to play my game and i can but just for a while, i build and run project and after some minutes it automatically destroy my Character, how can i fx this
first image is when i play game,
second image when it destroy my caracter( after 3 or 4 mins)
problem with Character being deleted is that you gave it an Initial Life Span of 100 in editor. If you click on character in level and look at Details, search for Life Span. If Initial Life Span is anything other than 0.0, it will be destroyed automatically after that amount of time passes (in this case, 100 seconds). If you set it to 0.0 seconds, it will last for entire game session.
For HUD not showing up, there are two causes:
You’re creating HUD and adding it to Viewport from Level Blueprint, which is created before Character is added to world at Begin Play. Since you have a check on Tick to Remove Widget from parent when Character’s Health == 0.0, it automatically removes widget because Character doesn’t exist yet (and thus Health value is null, or 0.0).
It looks like you’re getting CurrentHealth value for this check from an Interface, but that value is never set from Character. A much easier way to do this would be to get value directly from Character.
You’re setting entire widget to Hidden on Event Construct. I think you meant only to hide Resume Button? If that’s case, you can Set Visibility for that component only on Event Construct, instead.
So overall, your Event Construct and Event Tick in HUD_Bars Widget Blueprint would look like this:
Many Thx it worked perfect!, and thanks for advise about current healt.
this is my first game, because my last project was a virtual tour, but many thx you saved me