fix: Hpbar
Hpbar - is visible on screan
This commit is contained in:
parent
54396bc42c
commit
8abc59cf07
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -9,6 +9,7 @@
|
|||
#include "Items/AmmoBoxBase.h"
|
||||
#include "Items/HealthBoxBase.h"
|
||||
#include "Player/InteractionComponent.h"
|
||||
#include "Widget/UWBP_HpBar.h"
|
||||
|
||||
AExoPlayerCharacter::AExoPlayerCharacter()
|
||||
{
|
||||
|
|
@ -39,13 +40,15 @@ void AExoPlayerCharacter::BeginPlay()
|
|||
|
||||
if (PlayerHudClass)
|
||||
{
|
||||
GEngine->AddOnScreenDebugMessage(-1,5.0f,FColor::Green,TEXT("Jest klasa hudu playera"));
|
||||
PlayerHud = CreateWidget<UUserWidget>(GetWorld(),PlayerHudClass);
|
||||
if (PlayerHud)
|
||||
{
|
||||
PlayerHud->AddToViewport();
|
||||
PlayerHud->AddToPlayerScreen();
|
||||
GEngine->AddOnScreenDebugMessage(-1,5.0f,FColor::Green,TEXT("Dodaje to Viewportu"));
|
||||
UWBP_HpBar *HpBar=Cast<UWBP_HpBar>(PlayerHud);
|
||||
if (HpBar)
|
||||
HpBar->SetHp(CurrentHealth,MaxHealth);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user