Hello there.
I need help cause get stuck with a bunch of errors after created a class.
Before all was ok.
#include "CSGame/Public/Components/CSHealthComponent.h"
#include "GameFramework/Actor.h"
#include "GameFramework/GameMode.h"
#include "CSGame/Public/CSGameMode.h"
#include "Net/UnrealNetwork.h"
**// Called when the game starts
void UCSHealthComponent::BeginPlay()
{
Super::BeginPlay();
// Only hook if it is server
if (Role == ROLE_Authority) {
// This allows to subscribe to the player character
AActor* MyOwner = GetOwner();
if (MyOwner) {
MyOwner->OnTakeAnyDamage.AddDynamic(this, &UCSHealthComponent::HandleTakeAnyDamage);
}
}
CSHealth = DefaultHealth;
}**
I have tried to change it to GetLocalRole() - the same issue
The second error is:
I have no idea what is wrong