diff --git a/Content/Assets/NormieAsset/Test_anim.uasset b/Content/Assets/NormieAsset/Test_anim.uasset index 2e7963c..fa4acfe 100644 --- a/Content/Assets/NormieAsset/Test_anim.uasset +++ b/Content/Assets/NormieAsset/Test_anim.uasset Binary files differ diff --git a/Content/Assets/NormieAsset/VigilanteContent/Vehicles/West_Fighter_Typhoon/BP_West_Fighter_Typhoon.uasset b/Content/Assets/NormieAsset/VigilanteContent/Vehicles/West_Fighter_Typhoon/BP_West_Fighter_Typhoon.uasset index cad01e7..c4f99c6 100644 --- a/Content/Assets/NormieAsset/VigilanteContent/Vehicles/West_Fighter_Typhoon/BP_West_Fighter_Typhoon.uasset +++ b/Content/Assets/NormieAsset/VigilanteContent/Vehicles/West_Fighter_Typhoon/BP_West_Fighter_Typhoon.uasset Binary files differ diff --git a/Content/Levels/StartMap.umap b/Content/Levels/StartMap.umap index b2a8502..94d0c3a 100644 --- a/Content/Levels/StartMap.umap +++ b/Content/Levels/StartMap.umap Binary files differ diff --git a/Content/NunoContent/UI/InGame.uasset b/Content/NunoContent/UI/InGame.uasset index 7a0ed39..de40db2 100644 --- a/Content/NunoContent/UI/InGame.uasset +++ b/Content/NunoContent/UI/InGame.uasset Binary files differ diff --git a/Source/SkyFrontier/Private/HealthSystem.cpp b/Source/SkyFrontier/Private/HealthSystem.cpp index fd6f219..f63c56b 100644 --- a/Source/SkyFrontier/Private/HealthSystem.cpp +++ b/Source/SkyFrontier/Private/HealthSystem.cpp @@ -15,6 +15,13 @@ Shield = 0; } +void UHealthSystem::GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const +{ + Super::GetLifetimeReplicatedProps(OutLifetimeProps); + + DOREPLIFETIME(UHealthSystem, Health); +} + float UHealthSystem::GetHealth() const { return Health; @@ -40,6 +47,8 @@ } } + + void UHealthSystem::RecoverHealth(const float Amount) { if (Amount > 0) diff --git a/Source/SkyFrontier/Public/HealthSystem.h b/Source/SkyFrontier/Public/HealthSystem.h index 1254024..81f696d 100644 --- a/Source/SkyFrontier/Public/HealthSystem.h +++ b/Source/SkyFrontier/Public/HealthSystem.h @@ -25,6 +25,7 @@ UFUNCTION(BlueprintPure) float GetShield() const; + UFUNCTION(BlueprintCallable) void TakeDamage(float Amount); UFUNCTION(BlueprintCallable) @@ -38,6 +39,8 @@ virtual void BeginPlay() override; + virtual void GetLifetimeReplicatedProps(TArray& OutLifetimeProps) const override; + public: // Events DamageTakenEvent OnDamageTakenEvent; @@ -46,7 +49,7 @@ private: // This can be protected if we want to subclass the Health Component - UPROPERTY(VisibleAnywhere) + UPROPERTY(Replicated, VisibleAnywhere) float Health; UPROPERTY(EditAnywhere) float MaxHealth;