C# Created Gameplay Tags

Define Tags

Create a static class to store your tags.

public static class IslandGenTags
{
    public static readonly FGameplayTag IslandGen_Island = new FGameplayTag("IslandGen.Island", "Optional Comment");
}

Tags Registration

To ensure tags are available before the editor or other systems attempt to access them, register them early, ideally within your module's StartupModule.

public class FIslandGen : IModuleInterface
{
    public void StartupModule()
    {
        // Runs the static constructor and registers the gameplay tags
        RuntimeHelpers.RunClassConstructor(typeof(IslandGenTags).TypeHandle);
    }

    public void ShutdownModule()
    {
    }
}

Last updated