Invalid Attribute Value

I’m trying to calculate Experience in RPG based on Monster’s Level and Player’s Level.

But in my UGameplayEffectExecutionCalculation class, that two variables are always same value.

And also other attribute variables are not the values I want.

I cannot understand what’s going on , the documentary " GitHub - tranek/GASDocumentation: My understanding of Unreal Engine 5's GameplayAbilitySystem plugin with a simple multiplayer sample project. "

I just want to know how to get the exact Monster ( Source ) 's level, and Player ( Target ) 's Level value to calculate.
Please help!!

// Fill out your copyright notice in the Description page of Project Settings.


#include "GECMonsterExpExecution.h"
#include "LOCAttributeSet.h"
#include "AbilitySystemComponent.h"

struct FMonsterExpStatics
{
	//Capturedef declarations for attributes.
	DECLARE_ATTRIBUTE_CAPTUREDEF(Level);
	DECLARE_ATTRIBUTE_CAPTUREDEF(Experience);
	DECLARE_ATTRIBUTE_CAPTUREDEF(MaxExperience);
	 
	//Default constructor.
	FMonsterExpStatics()
	{
		DEFINE_ATTRIBUTE_CAPTUREDEF(ULOCAttributeSet, Level, Source, true);
		DEFINE_ATTRIBUTE_CAPTUREDEF(ULOCAttributeSet, Experience, Target, true);
		DEFINE_ATTRIBUTE_CAPTUREDEF(ULOCAttributeSet, MaxExperience, Target, true);
	}

};

static const FMonsterExpStatics& MonsterExpStatics()
{
	static FMonsterExpStatics ExpStatics;
	return ExpStatics;
}

UGECMonsterExpExecution::UGECMonsterExpExecution()
{
	RelevantAttributesToCapture.Add(MonsterExpStatics().LevelDef);
	RelevantAttributesToCapture.Add(MonsterExpStatics().LevelDef);
	RelevantAttributesToCapture.Add(MonsterExpStatics().ExperienceDef);
	RelevantAttributesToCapture.Add(MonsterExpStatics().MaxExperienceDef);
}

void UGECMonsterExpExecution::Execute_Implementation(const FGameplayEffectCustomExecutionParameters& ExecutionParams, OUT FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const
{
	UAbilitySystemComponent* TargetABSC = ExecutionParams.GetTargetAbilitySystemComponent();
	AActor* TargetActor = TargetABSC ? TargetABSC->GetAvatarActor() : nullptr;

	UAbilitySystemComponent* SourceABSC = ExecutionParams.GetSourceAbilitySystemComponent();
	AActor* SourceActor = SourceABSC ? SourceABSC->GetAvatarActor() : nullptr;

	const FGameplayEffectSpec& Spec = ExecutionParams.GetOwningSpec();
	const FGameplayTagContainer* SourceTags = Spec.CapturedSourceTags.GetAggregatedTags();
	const FGameplayTagContainer* TargetTags = Spec.CapturedTargetTags.GetAggregatedTags();

	FAggregatorEvaluateParameters EvaluationParameters;
	EvaluationParameters.SourceTags = SourceTags;
	EvaluationParameters.TargetTags = TargetTags;

	float SourceLevel = 0.f;
	ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(MonsterExpStatics().LevelDef, EvaluationParameters, SourceLevel);

	float TargetLevel = 0.f;
	ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(MonsterExpStatics().LevelDef, EvaluationParameters, TargetLevel);

	float TargetExperience = 0.f;
	ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(MonsterExpStatics().ExperienceDef, EvaluationParameters, TargetExperience);

	float TargetMaxExperience = 0.f;
	ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(MonsterExpStatics().MaxExperienceDef, EvaluationParameters, TargetMaxExperience);

	float Level = Spec.GetSetByCallerMagnitude(FGameplayTag::RequestGameplayTag(FName("Data.Level")));

	float Exp = 0.f;
	float MaxExp = 0.f;

	if (SourceLevel == TargetLevel)
	{
		Exp = 50.f;
	}
	else if (SourceLevel > TargetLevel)
	{
		Exp = 50.f * (SourceLevel - TargetLevel + 1);
	}
	else if (SourceLevel < TargetLevel)
	{
		Exp = 50.f / (TargetLevel - SourceLevel + 1);
	}

	MaxExp = 100 * exp2(TargetLevel - 1);

	OutExecutionOutput.AddOutputModifier(FGameplayModifierEvaluatedData(MonsterExpStatics().LevelProperty, EGameplayModOp::Additive, Level));
	OutExecutionOutput.AddOutputModifier(FGameplayModifierEvaluatedData(MonsterExpStatics().ExperienceProperty, EGameplayModOp::Additive, Exp));
	OutExecutionOutput.AddOutputModifier(FGameplayModifierEvaluatedData(MonsterExpStatics().MaxExperienceProperty, EGameplayModOp::Additive, TargetLevel));

}