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

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

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

  • @Kekdot
    @Kekdot  ปีที่แล้ว +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/

  • @GEK0dev
    @GEK0dev ปีที่แล้ว +3

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

  • @prismgod1904
    @prismgod1904 ปีที่แล้ว +10

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

    • @Califibradu03
      @Califibradu03 8 หลายเดือนก่อน

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

    • @makorain4668
      @makorain4668 หลายเดือนก่อน

      I also would love an explanation as to why we have to put it before. I'm so confused as to why that worked and I'm so happy it's working now but I'm soooo lost on why it works lol

    • @PerryButler
      @PerryButler 6 วันที่ผ่านมา +1

      ​@@makorain4668 Because in multiplayer, both player character blueprints exist on the client, and both exist on the server, but on either side you will only be controlling one of those characters (mapping controls to it). So the GetController > Cast To PlayerController succeeds for the locally controlled character, binding the inputs and making it controllable, but fails for the remote character which it will not be controlling. So you need to handle the CastFailed pin there.

  • @Derknomicon
    @Derknomicon ปีที่แล้ว

    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 9 หลายเดือนก่อน

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

  • @fafatogames
    @fafatogames ปีที่แล้ว +3

    add this video to "Multiplayer playlist"

  • @waw4428
    @waw4428 ปีที่แล้ว +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

    • @Wesley5n1p35
      @Wesley5n1p35 9 หลายเดือนก่อน

      following

  • @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!

  • @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?

  • @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 11 หลายเดือนก่อน

      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.

  • @dribbler8131
    @dribbler8131 2 หลายเดือนก่อน

    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? :)

  • @DarkRodFR
    @DarkRodFR 9 หลายเดือนก่อน

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

  • @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?

  • @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

  • @kevinsmith3348
    @kevinsmith3348 11 หลายเดือนก่อน

    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.

  • @Daniel-sn5se
    @Daniel-sn5se 7 หลายเดือนก่อน

    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.

  • @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 8 หลายเดือนก่อน

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

    • @VizibilityZero
      @VizibilityZero 8 หลายเดือนก่อน +1

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

    • @cordellbriggs4984
      @cordellbriggs4984 8 หลายเดือนก่อน

      @@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 8 หลายเดือนก่อน

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

  • @rifthaven
    @rifthaven ปีที่แล้ว

    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 ปีที่แล้ว

      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

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

    what about if you want to hurt the other person

  • @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.

  • @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.

  • @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.