To use the IGameplayTagAssetInterface You’ll have to create an actor in C++. Then reparent your base class with the new. Not hard.
Create a new C++ class. Name it BaseGamePlayTags. Open Visual Studio and pretty much paste in the following to the appropriate file.
BaseGamePlayTags.h
// Copyright you etc. All rights reserved.
#pragma once
#include <CoreMinimal.h>
#include <GameFramework/Actor.h>
#include <GameplayTagContainer.h>
#include <GameplayTagAssetInterface.h>
#include "ABaseGamePlayTags.generated.h"
UCLASS()
class YOURGAME_API AABaseGamePlayTags : public AActor, public IGameplayTagAssetInterface
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AABaseGamePlayTags();
// Gameplay Tag Container variable, Exposed to BP
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config GameplayTags")
FGameplayTagContainer YourTagContainerVariable;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Get GameplayTags
virtual void GetOwnedGameplayTags(FGameplayTagContainer& TagContainer) const override { TagContainer = YourTagContainerVariable; return; }
};
BaseGamePlayTags.cpp
// Copyright you etc. All rights reserved.
#include "Path/to/ABaseGamePlayTags.h"
// Sets default values
AABaseGamePlayTags::AABaseGamePlayTags()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void AABaseGamePlayTags::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AABaseGamePlayTags::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}