Thanks for the reply
Below shows details panel for characters GAS component , to the right i have given its default starting data as my table.
My very simple attribute class declaration
// Uses macros from AttributeSet.h
#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)
class UC_CharAttributeSet : public UAttributeSet
{
GENERATED_BODY()
friend AC_GasCharacterBase;
protected:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CharAttribute")
FGameplayAttributeData Health;
ATTRIBUTE_ACCESSORS(UC_CharAttributeSet, Health)
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CharAttribute")
FGameplayAttributeData WalkSpeed;
ATTRIBUTE_ACCESSORS(UC_CharAttributeSet, WalkSpeed)
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CharAttribute")
FGameplayAttributeData JumpCoef;
ATTRIBUTE_ACCESSORS(UC_CharAttributeSet, JumpCoef)
};
below is my character cpp code
AC_GasCharacterBase::AC_GasCharacterBase()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
mvo_pGasComp = CreateDefaultSubobject<UAbilitySystemComponent>(TEXT("CharGasComponent"));
}
// Called when the game starts or when spawned
void AC_GasCharacterBase::BeginPlay()
{
Super::BeginPlay();
//Initializes the attribute set using a data table.
verifyf(IsValid(mvo_pGasComp), TEXT("Invalid gas comp"));
//initlaise attribute pointer, hopefully this should be populated with data from my table
mvo_pCharAttrSpec = mvo_pGasComp->GetSet<UC_CharAttributeSet>();
verifyf(IsValid(mvo_pCharAttrSpec), TEXT("Invalid gas attributes"));
}
// Called every frame
void AC_GasCharacterBase::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
mfo_DisplayAttributes();
}
And below is my data table
Thanks again

