Announcement

Collapse
No announcement yet.

Player Health from Health Pickup Not updating

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Player Health from Health Pickup Not updating

    I have a simple health system in place that works with UMG. I have checked that all the variables are sound and of the correct type. The player collides with the health pickup without any issue, but the player's health does not update correctly. I have damage volumes in place which remove armor and then health as they are supposed to, but for some reason the health pickup is not adding to the player's health. I have created this exact system in a precious project without any issue, so I am at a loss. I would really appreciate any help or directions that I can explore. I have included screenshots below. Thank you I know it is something silly that I am overlooking.

    #2
    I assume 1 is the max health? Check your first comparison on the health pickup (1>player health). If that's true, nothing will happen. Perhaps you meant to compare (playerhealth>1)
    Tracey White - Senior Design Visualization Artist / PC Game Enthusiast / Drummer
    My Maze Game development video series
    My Maze Game Blog

    Comment


      #3
      the first script doesnt make much sense to me because it says if player armor is less than 0, add that number to current health and update current health.. wouldnt that just be adding 0 to current health, doing nothing?.. the second script it appears like on pickup event you have it saying "if 1.0 is greater than player health is false" then you add 30 points to current health.. and immediately after that you have the script saying "if player health is greater than 1.0 (or 10, cant read it) then set player health to this value" so any amount of health over this number would get erased right here

      some additional advice is not to use an event tick to regenerate armor.. maybe after the event in which armor takes damage you use a retriggerable delay to delay armor regen and then use a looping timer which fires off a custom event that adds a small amount back to your current armor every time the timer fires, and when current armor >= max armor you clear and invalidate that timer to stop the regen once it maxes out.. no event tick needed for regeneration with a timer by event node

      Comment


        #4
        Originally posted by Tearl View Post
        I assume 1 is the max health? Check your first comparison on the health pickup (1>player health). If that's true, nothing will happen. Perhaps you meant to compare (playerhealth>1)
        One is the max health yes. I was following a tutorial series, and that is how they set it up. It seems a bit wonky to me as well.

        Comment


          #5
          I may just pick another series, I just wanted something quick to show some basic combat.

          Comment


            #6
            ive watched some youtube tutorials and i can safely say that most of them give a fair bit of bad advice

            what are you trying to achieve with your health/armor system? you want an easily set health, regen capabilities, and armor values im assuming are set by equipment? maybe i could help you come up with something
            Last edited by burntbyhellfire; 04-21-2018, 03:04 AM.

            Comment


              #7
              Would also interest me what you exactly would like to do with the basic combat, might also can help.
              - Martin

              A Simple Prototype

              https://www.martinegger.org/

              Technical Producer

              Comment


                #8
                heres a blueprint i sketched out recently for a stamina regen, health regen works the same.. but this is what i use instead of relying on an event tick.. the 5 second delay is just how long i have to go without using stamina before regen kicks in.. the timer by event runs on a loop, adjustable on how long between cycles and each cycle refills a small bit of stamina until stamina is maxed out, at which point the timer is stopped and the script stops running.. its all set to a custom event that i can call at the end of any action that uses stamina (jumping, sprinting, etc).. the invalidator custom event is called at the beginning of any event that uses stamina to stop stamina regen when more stamina is used

                Comment

                Working...
                X