// Copyright Epic Games, Inc. All Rights Reserved. #include "LyraCharacterWithAbilities.h" #include "AbilitySystem/Attributes/LyraCombatSet.h" #include "AbilitySystem/Attributes/LyraHealthSet.h" #include "AbilitySystem/LyraAbilitySystemComponent.h" #include "AbilitySystemComponent.h" #include "HAL/Platform.h" #include "Misc/AssertionMacros.h" ALyraCharacterWithAbilities::ALyraCharacterWithAbilities(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { AbilitySystemComponent = ObjectInitializer.CreateDefaultSubobject(this, TEXT("AbilitySystemComponent")); AbilitySystemComponent->SetIsReplicated(true); AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed); CreateDefaultSubobject(TEXT("HealthSet")); CreateDefaultSubobject(TEXT("CombatSet")); // AbilitySystemComponent needs to be updated at a high frequency. NetUpdateFrequency = 100.0f; } void ALyraCharacterWithAbilities::PostInitializeComponents() { Super::PostInitializeComponents(); check(AbilitySystemComponent); AbilitySystemComponent->InitAbilityActorInfo(this, this); } UAbilitySystemComponent* ALyraCharacterWithAbilities::GetAbilitySystemComponent() const { return AbilitySystemComponent; }