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
Due to initialization timing, these tags are not found in the global GameplayTags static class. You must store the returned FGameplayTag in your own static field for later use.
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