Overview
WCGASAttributeInitializer is an ActorComponent that automatically creates and initializes the WCGASAttributePool AttributeSet on any actor with an AbilitySystemComponent. It eliminates the need for manual attribute setup and ensures consistent initialization across all attribute-using actors in your project.
Core Functionality
- Automatically detects AbilitySystemComponent using multiple fallback methods for maximum compatibility
- Creates WCGASAttributePool AttributeSet if not already present on the ASC
- Creates and registers external AttributeSet classes specified in the ExternalAttributeSets array
- Initializes all registered attributes with default values from Project Settings
- Applies optional per-actor attribute overrides from data assets for class-based systems
- Triggers attribute modification system to calculate derived attributes automatically
- Caches ASC reference for efficient subsequent access
- Provides debug logging for initialization troubleshooting
Initialization Flow
Automatic Initialization (Default Behavior):
- Component reaches BeginPlay
bAutoInitialize = true triggers automatic initialization
- ASC detection using prioritized method chain
- External AttributeSets created and registered with ASC (if specified)
- AttributePool creation and registration with ASC