How To Make a Replicated Health Bar | Multiplayer | Beginner Blueprint Tutorial | Unreal Engine 5

Поділитися
Вставка
  • Опубліковано 30 вер 2024

КОМЕНТАРІ • 42

  • @Kekdot
    @Kekdot  10 місяців тому +1

    Hey guys,
    👨‍🏫 My Patreon link:
    www.patreon.com/kekdot
    Download Project Files | Premium Tutorials | Courses
    💦 Get our Game on Steam | Kekdot Center:
    store.steampowered.com/app/1487180/Kekdot_Center/

  • @prismgod1904
    @prismgod1904 Рік тому +9

    for the ones that using the 5.10 template, put the Event Beginplay program BEFORE the mapping otherwise it doesn't work

    • @Califibradu03
      @Califibradu03 5 місяців тому

      Thanks have been struggling so much, could you explain why we have to do it before and not after ?

  • @dribbler8131
    @dribbler8131 30 хвилин тому

    Nice video! Quick Question - Is the Update Health function which you choose to run on Server is the Event AnyDamage (Which is also run on the server) should perform the same way please? :)

  • @Daniel-sn5se
    @Daniel-sn5se 5 місяців тому

    After watching 10 other poor tutorials about health I cannot express how much I loved this. Top quality. Great habits. Clean code. Feels like porn.

  • @GEK0dev
    @GEK0dev Рік тому +3

    Man these tutorials are coming out like lightning! Keep it up mate!

  • @waw4428
    @waw4428 11 місяців тому +1

    Kekdot, did you try this with a login from lobby to game map? I tried this after your video on how to create and join servers, and it doesn't work. When the players connect to a lobby, on creates a server, then all others join, other players widgets aren't updated. Then I tried activating the widget when the second player joins (based on proximity) and it world perfectly. However, I'm doubting the stability of such choice. Also, any suggestion on making a dedicated server? Ty :D

  • @fafatogames
    @fafatogames Рік тому +3

    add this video to "Multiplayer playlist"

  • @Rlador
    @Rlador Рік тому +1

    @Kekdot Is it possible to somehow prohibit changing the size of the widget when the player's camera is removed. If the project has a player's camera with a zoom, and if it gets very close to 300, but the widget is very, very small. Are there any other solutions?

  • @yushkovyaroslav
    @yushkovyaroslav Рік тому +1

    Only works client side. Especially the text. 0 Clue how it replicates for him and what he did to replicate the health bar. Still 0 clue how it works for him its basically witch craft in my mind... XD

    • @Kekdot
      @Kekdot  Рік тому +1

      Just watch the video lol. Do it step by step and you have a replicated healthbar, what’s not to understand about it? You testing properly?

    • @yushkovyaroslav
      @yushkovyaroslav Рік тому +2

      @@Kekdot Yeah sorry, I think it's because of engine difference. I did some research + someone in your comments mentioned it's something to do with input mappings. If you do it after, it won't work. I was confused because for me it would only be client side. As in values are correct but visual can only be seen by the owner and does not update for everyone else (or is the same for everyone from owner perspective)

    • @PRiMezGFX
      @PRiMezGFX Рік тому

      @@Kekdot A few people are having this issue including myself. The healthbar does not replicate. Can you recreate in a newer version of the programme and see if it works and let us know?

    • @lukelawrence1931
      @lukelawrence1931 Рік тому

      @@PRiMezGFX @ Yeah that would be sweet...same issue here...Only thing I'm using a pawn and not third-person template. I'm not 100% certain pawns automatically replicate this kind of thing.

    • @PRiMezGFX
      @PRiMezGFX Рік тому

      @@lukelawrence1931 Im unsure. I know that the health is replicating as the string and death animation is displaying this but its just the Healthbar that seems to be the issue.

  • @johndoe35717
    @johndoe35717 Рік тому +1

    what about if you want to hurt the other person

  • @hundsy5287
    @hundsy5287 Рік тому +1

    How can I add the enemy health in my screen as a widget for multiplayer? like when I join in a session the other player can see my Hp on top right

    • @afterparty0069
      @afterparty0069 Рік тому

      I’m trying to do the same thing, have you figured it out?

  • @PPp-fg3ps
    @PPp-fg3ps Рік тому +1

    At 05:30, the health bar suddenly became replicated without showing how it became replicated

    • @JikaiNoTsubasa
      @JikaiNoTsubasa Рік тому +1

      Because each player is an actor replicated by default, and the widget is attached to the actor, so it appears, but the values inside the bar (like health) is not replicated, only the widget

  • @zakcook
    @zakcook Рік тому +1

    Great tutorial, now what if I wanted this to be hidden on the owning player pawn and only be displayed on other players in the game? Currently it floats in the way of their aim/view.

    • @kevinsmith3348
      @kevinsmith3348 8 місяців тому

      At possessed or Begin (or whenever you deem correct not to have the healthbar), you could Set Visibility and target the Widget component that you added to your ThirdPersonCharacter.

  • @kevinsmith3348
    @kevinsmith3348 8 місяців тому

    This method seemed to require modification for me. I had to add to the Begin process, Switch Has Authority, and cast the widget separately in Authority and Remote. Seemed to work for players then, however, can't seem to get the AI to replicate. Only the Server sees everyone health. The Client can see the Server's health but not the AI. If anyone has solution/tutorial, please let me know.

  • @DrastyAlimo
    @DrastyAlimo Рік тому +1

    How about for splitscreen coop and the health bar is at the top of the screen and not attached to the actor ?

    • @Kekdot
      @Kekdot  Рік тому +1

      Simply have each player pull the other players character or player state ref (depending on where you save the hp) and then display that in the healthbars.
      In local couch co-op its even simpeler, just pull player character 0 and 1.

    • @DrastyAlimo
      @DrastyAlimo Рік тому

      @@Kekdot my problem is that the widget is rendering in the same position, I'm using the template rpg all in one from the marketplace and the widget is not only the health bar but the whole system like inventory, skill and pet system, but thanks anyway! I'll try it here!

  • @marineinrecovery1282
    @marineinrecovery1282 Рік тому

    My health bar won't replicate. I have replication on, no conditions. I've restarted my system and tried everything I can think of, but I cannot get the health bar to replicate.

  • @o-super2744
    @o-super2744 Рік тому

    Widget component attached to a Character are very very very heavy on computing. If you do a game with many units, this is not a solution.

  • @DarkRodFR
    @DarkRodFR 6 місяців тому

    You can replace append with format text : {life} / {maxlife}

  • @rifthaven
    @rifthaven 10 місяців тому

    I followed your video exactly and only my Server seems to update the health number, if I click it on the client side it adds a second server text so its like Client 1: 100 Server: 90 Server: 90 Client 1: 100 Server: 90 Server: 90
    Any Ideas?.. (:
    EDIT: Super simple, I didnt mark replicate in the health variable!

    • @rifthaven
      @rifthaven 10 місяців тому

      Im going to reply here just incase anyone else has the same issue I was having:
      I use Kekdot's Top Down Multiplayer Ready system, the third folder, so I have to put most of my stuff in Client Controller etc rather then the Server AI Character for input commands etc....
      What I had to do was drag the Server_AI_Character variable in order to get the Health Variable from the WB_HealthBar and then just drag the Server AI Character Variable into the Target Pin and it works as normal!
      TLDR: Make sure you put the Update_Health event inside the Client_Controller and use the Server_AI_Character variable to get Health variable if you use TopDownMultiplayerReadyReliable

  • @yunusemremanap7426
    @yunusemremanap7426 Рік тому +1

    i love you man

  • @Derknomicon
    @Derknomicon 9 місяців тому

    I'd love to see a tutorial that covers a project that has different characters to choose from that are all children of a base character blue print. They all have their own specified health values that are different from one another and then have those values displayed and updated (via character hud/widget) depending on damage or healing taken during a match. I haven't really seen anyone else cover this specific topic thoroughly, if anyone else has please let me know.

    • @jesperchristiansen6019
      @jesperchristiansen6019 6 місяців тому

      You can do this by making the CharacterRef a object reference of the parent BP, this worked for me at least :)

  • @VizibilityZero
    @VizibilityZero Рік тому

    In newer versions of ue5 when you validate get the Character_ref variable in the widget it returns invalid on the client. Not sure how to fix that. Widget progress bar also does not replicate to other players, any help @Kekdot ? edit: it looks as though the client is not getting validated when it loads in to the world, updated original question.

    • @cordellbriggs4984
      @cordellbriggs4984 5 місяців тому

      Did you figure out what the issue was with this ? I'm having the same issue.

    • @VizibilityZero
      @VizibilityZero 5 місяців тому +1

      @@cordellbriggs4984 I actually never did haha, have stuck to non-replicated projects for the time being

    • @cordellbriggs4984
      @cordellbriggs4984 5 місяців тому

      @@VizibilityZero just figured out, that if I stuck the replication snippet before the input mapping on the BP_third person character it worked!

    • @VizibilityZero
      @VizibilityZero 5 місяців тому

      @@cordellbriggs4984 huh interesting! I'll have to give that a shot next time! Thanks for figuring it out haha

  • @jeuxdz
    @jeuxdz Рік тому

    update on tick is the most thing to dont do

    • @Kekdot
      @Kekdot  Рік тому +1

      Only depends on which logic you run on it. Essentially the entire game runs on tick.
      Particles, the 3D world, the standard character movement component and all it’s calculations.
      When you run Lean code then tick is no issue for modern day computers. Simply keep in mind that you should only run lightweight logic on tick if you have no other choice.