2DSlide controller Character gets destroyed automatically

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 :confused:
first image is when i play game,
second image when it destroy my caracter( after 3 or 4 mins)

i hope some one can help me, or i will do again my game in a new project :frowning:

looks like your character has reacted end of world. I’ve got a very similar problem Endless runner crashes editor, is there a there a limit to distance? - World Creation - Epic Developer Community Forums

but even if i dont move, i just wait some mins and it destroy my character :frowning:

Yeah, it will take me some mins

Hi ,

Can you and upload your project somewhere and get me a download link? If you’d like to do so privately, you can send it via PM on forums:

I’m looking into another project that does same thing, and I’d like to see if it’s related. Thanks!

Hi ,

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.

45317-initiallifespan.png

For HUD not showing up, there are two causes:

  1. 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).
  2. 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.
  3. 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:

And your Create Widget would be in your 2DSideScrollerCharacter Blueprint, like this:

45316-createwidget.png

Hope that helps! Let me know if you have any questions.

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 :smiley: