In this lesson, you will learn how to leverage built-in Gameplay Ability System (GAS) console commands to inspect, track, and manipulate your character's attribute values during runtime to resolve balancing issues.
When balancing your game, simply looking at your UI isn't always enough—you need to see the "truth" held within the AttributeSet. Unreal’s GAS provides robust console commands that act as a window into these internal values, allowing you to bypass the UI layer and verify the actual math behind your GameplayEffects.
Inspecting Live Attributes
The most powerful tool at your disposal is showdebug abilitysystem. Once enabled (via the tilde key ~), this overlay displays a list of all your active Attribute Sets and their current values directly on the viewport. This is vital for checking if your PreAttributeChange logic is correctly clamping stats or if your GameplayEffectExecutionCalculations are applying the expected modifiers.
Real-Time Value Modification
Sometimes, you need to test a "what-if" scenario without manually triggering an ability or changing a data asset. You can use the AbilitySystem.Debug.PrintAttribute command to log current stats to the output console, or use specific attribute modification commands to force changes.
For example, if you suspect your movement speed is being calculated incorrectly, you can use the command:
AbilitySystem.Debug.Attribute Health 100.0
(Note: Depending on your specific project setup, you may need to use AbilitySystem.Debug.ModifyAttribute or custom wrappers if your base implementation requires specific targeting).
Troubleshooting Tips
- The "Base" vs. "Current" Value: Remember that
BaseValuerepresents the attribute without temporary modifiers, while theCurrentValuereflects the result of all appliedGameplayEffects. If your UI looks wrong, compare these two values in the debug overlay to determine if a permanent base change occurred or if a lingering temporary effect is the culprit. - Filtering: Use the
AbilitySystem.Debug.Tagscommand alongside attribute inspection to see if an active "Cooldown" or "State" tag is suppressing the attribute change you expect.
Key Takeaway: Use showdebug abilitysystem to verify if your mathematical issues stem from incorrect BaseValue definitions or faulty GameplayEffect modifiers in real-time.