Unreal Engine 4 - Building a Simple, Responsive Healthbar

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024

ความคิดเห็น • 8

  • @nativeblack5251
    @nativeblack5251 4 ปีที่แล้ว

    The way you set up health bar is very different from how I've seen it done by so many others. Glad to see it. I do have a question.
    My issue is converting the percentage of the progress bar into whole numbers. I have two separate text boxes for min/max health along side the progress bar however instead of the numbers displaying say 67/100 it reads 67.2/100. Is there a way you know of to convert the float into integers with either a progress bar or text box?
    I like the progress bar but for my narrow skill level adding and subtracting health with floats either over heals the player or does not kill the player because they still have .4 health left when the damge taken should have reduced it to zero.

    • @Cronza
      @Cronza  4 ปีที่แล้ว +1

      Hey nativeblack! I apologize the delayed response
      What you can do is use the 'Round' node in order to round a float value to the nearest whole number:
      docs.unrealengine.com/en-US/BlueprintAPI/Math/Float/Floor/index.html
      This way, if the damage reduces the health to .6, it'll round to 1. If it reduces down to .4, it'll be 0.

  • @joeanrachelmiller6529
    @joeanrachelmiller6529 4 ปีที่แล้ว

    you are the first person I have heard speaking of the term "expensive to the computer". Could you pretty please do some more tutorials about what and how this all means for us?

    • @Cronza
      @Cronza  4 ปีที่แล้ว +1

      Ah, great point! Often times tutorials don't cover the "expense" to the computer when buildings things. Some times, things are built that require better hardware, but since it's simply shown as "The way to do it", listeners will accidently create 'expensive' code.
      I'd love to make a video on this topic!

  • @patcastech
    @patcastech 5 ปีที่แล้ว

    cant find set player ref :(

    • @Cronza
      @Cronza  4 ปีที่แล้ว

      Sorry for such a late reply Alex! Were you ever able to resolve this?

  • @Adde4life
    @Adde4life 5 ปีที่แล้ว

    good vid!

    • @Centor30
      @Centor30 5 ปีที่แล้ว

      yeet