Player Health with Unity and Playmaker

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 22

  • @guillermemathaeus
    @guillermemathaeus 4 года назад +1

    Great tutorial, Romi! Thanks... Do you have a complete course about make a 2d plataformer game like this with Playmaker too?

    • @RomiFauzi
      @RomiFauzi  4 года назад

      Thanks a lot, unfortunately not complete yet, but there other videos in this playlist: ruclips.net/p/PLYYCDVRRWC7fub6-O2SBi9Vzo7a6PMX_7

  • @crusenho
    @crusenho 3 года назад

    My Player doesn't knockback but only jump up when touched by the enemy, I followed your instruction but it doesn't work. I used the new input system in my player FSM Movement (just like your previous video) perhaps is that the reason or something else? The X value of the player doesn't move at all and only the Y value works when knockback (add force 2d issue). Please help!

  • @Dustiwi
    @Dustiwi 3 года назад

    my playmaker doesnt show the inspector checkbox, instead it says output and input, what can i do? what do those mean?

    • @RomiFauzi
      @RomiFauzi  3 года назад

      The newer playmaker splits the inspector variable into 2, which are input and output, this is useful for creating FSM templates that can be used as an action, but if you want to use it as an exposed variable, setting the var to input should do the trick.

    • @Dustiwi
      @Dustiwi 3 года назад

      @@RomiFauzi thx for the reply, im having a little problem tho, followed the tutorial and eveything works perfectly except for one thing, the current hp is counting down ok, but the dead event doest fire when the value gets to 0. it only fires when it goes below zero, and the hp bar would only start updating after the first hit, meaning the hp bar is always 1 value behind. what am i missing?

    • @RomiFauzi
      @RomiFauzi  3 года назад

      @@Dustiwi for the dead event not triggering when health is zero, you need to compare the health value if equal or less than 0, if you only compare less than 0, then it never checks if it is equal than 0

    • @RomiFauzi
      @RomiFauzi  3 года назад

      @@Dustiwi As for the health only updating after the first hit, maybe there is an issue with the order of your actions in the related states, could you check if the order of the actions is correct?

    • @Dustiwi
      @Dustiwi 3 года назад

      @@RomiFauzi thank u so much, it was all the order of the actions, i had the less or equal to 0, but i re arranged the order and now it works :)

  • @835jaber
    @835jaber 4 года назад

    Wow...... Great job keep it up

    • @RomiFauzi
      @RomiFauzi  4 года назад +1

      Thanks a lot buddy!

  • @curb47
    @curb47 4 года назад

    Really great tutorial, but I am having a problem... In the health bar graphics HUD, when the Slider value (on Slider component) is moved, rather than masking one of the battery icons, it scales the image down, so I still have 5 batteries but the image is smaller.
    I've been trying to solve it but I can't, and I'm following the tutorial precisely. What's going on? Thanks.

    • @RomiFauzi
      @RomiFauzi  4 года назад +1

      Thank you so much! regarding the issue is the healthbar assigned to the Fill Rect field under the Slider component?

    • @curb47
      @curb47 4 года назад

      @@RomiFauzi Hello. I've fixed it now thanks. I realised the scaling was caused by the fact the image was a child of the Health Bar object, so the scaling affected the graphic (or something like that). I actually refined the health bar graphic by using the 'Image Type : Filled' setting, and the slider (Fill Amount) works in the same way you used the Slider component. Thank you for your amazing tutorial though, I love the health system you created, and have implemented it in my little game.

    • @RomiFauzi
      @RomiFauzi  4 года назад

      Awesome, glad to hear you've fixed it! and thank you for sharing your solution, it might help others when facing same issues.

    • @curb47
      @curb47 4 года назад

      @@RomiFauzi To answer your question, yes, I assigned the healthbar to the Rect Fill field, I actually went through your tutorial many times to see where I was going wrong, but I still had the same problem. However, I did take a slight deviation from your method, in that I didn't use a tiled sprite (you used a square sprite 512x512 and tiled to 6.5), I created a health bar graphic in Photoshop (simple green to red gradient) that filled the space, so no tiling required. I can't see why this would give me a different result to your method, but that is the only thing I did differently. Thanks again, and all the best from London, UK.

  • @sksnike2343
    @sksnike2343 4 года назад

    How u make everything easy

    • @RomiFauzi
      @RomiFauzi  4 года назад

      Well, with persistent years of experimenting.

    • @sksnike2343
      @sksnike2343 4 года назад

      @@RomiFauzi please can u tell me when i click or hit somthing it load next scene

    • @RomiFauzi
      @RomiFauzi  4 года назад

      You can use the UI Click event/transition as a global event on the button FSM to detect click, and on the target state, use the LoadScene action to go to the next scene.

  • @boldfrog82
    @boldfrog82 4 года назад

    The best..