I’m trying to implement a classic Health bar in a gameplay UI. I got it working on the server but not on the client. In the UUserWidget the Health percentage is updated like supposed but not the Health bar. I tried a lot of things and I also tried in blueprint with the same result.
This is my cpp UUserWidget code (the function is called by the player controller and the log report the good percentage for both server and client)
#include "PuzzlePlatform/UI/GameplayUI.h"
#include "Components/ProgressBar.h"
void UGameplayUI::UpdateProgressBar(float HealthPercentage)
{
if (HealthBar)
{
UE_LOG(LogTemp, Warning, TEXT("GameplayUI UpdateProgressBar Health Percent %f"), HealthPercentage);
HealthBar->SetPercent(HealthPercentage);
}
}
I tried to replicate the variable or not and I tried to directly pass the Health percentage to the UI but I got always the same result the variable is updated but not the Progress Bar. This is not the first time I created multiplayer UI but the first I use progress bar in multiplayer maybe it is different than other widget object. Thanks for your help!