From fdfa37a346027b30e0ff8a6875fe17c1d19bd31b Mon Sep 17 00:00:00 2001 From: baz Date: Sat, 9 Mar 2024 03:51:16 +0000 Subject: [PATCH] UpdateHealthbar on BindOwner --- Source/Nakatomi/UI/EnemyHealthbarUserWidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Nakatomi/UI/EnemyHealthbarUserWidget.cpp b/Source/Nakatomi/UI/EnemyHealthbarUserWidget.cpp index 135f169..90fb329 100644 --- a/Source/Nakatomi/UI/EnemyHealthbarUserWidget.cpp +++ b/Source/Nakatomi/UI/EnemyHealthbarUserWidget.cpp @@ -12,7 +12,8 @@ void UEnemyHealthbarUserWidget::BindOwner(AEnemyCharacter* NewOwner) if (Owner) { auto healthComponent = Owner->GetHealthComponent(); - healthComponent->OnDamaged.BindUFunction(this, "UpdateHealthbar"); + healthComponent->OnDamaged.BindUFunction(this, "UpdateHealthbar"); + UpdateHealthbar(); } }