bUseDebugTargetFromHud
bUseDebugTargetFromHud
#Overview
name: bUseDebugTargetFromHud
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bUseDebugTargetFromHud is to control the debug target selection for the Ability System Component when displaying debug information. It is a configuration setting that affects how debug information is gathered and displayed in the Unreal Engine’s Gameplay Ability System.
This setting variable is primarily used by the Gameplay Abilities plugin, specifically within the Ability System Component. It is referenced in the AbilitySystemComponent and AbilitySystemGlobals classes.
The value of this variable is set in the AbilitySystemGlobals constructor, where it is initialized to false by default. It can be modified through configuration files or at runtime.
This variable interacts with the HUD’s debug target functionality. When set to true, it causes the Ability System Component to use the current debug target from the HUD instead of its own debug target when displaying debug information.
Developers should be aware that this variable affects debugging workflows. When enabled, it changes the source of the debug target, which can impact how ability system-related debug information is displayed and interpreted.
Best practices for using this variable include:
- Use it primarily for debugging purposes, not in production code.
- Be consistent in its usage across the development team to avoid confusion when debugging.
- Consider creating a toggle in the game’s debug menu to easily switch between using the HUD’s debug target and the Ability System’s own target.
- Document any changes to this setting in the project to ensure all team members are aware of the current debugging configuration.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:18, section: [/Script/GameplayAbilities.AbilitySystemGlobals]
- INI Section:
/Script/GameplayAbilities.AbilitySystemGlobals
- Raw value:
true
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemComponent.cpp:2302
Scope (from outer to inner):
file
function void UAbilitySystemComponent::OnShowDebugInfo
Source code excerpt:
UAbilitySystemComponent* ASC = nullptr;
if (UAbilitySystemGlobals::Get().bUseDebugTargetFromHud)
{
ASC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(HUD->GetCurrentDebugTargetActor());
}
else
{
ASC = GetDebugTarget(TargetInfo);
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Private/AbilitySystemGlobals.cpp:43
Scope (from outer to inner):
file
function UAbilitySystemGlobals::UAbilitySystemGlobals
Source code excerpt:
AbilitySystemGlobalsClassName = FSoftClassPath(TEXT("/Script/GameplayAbilities.AbilitySystemGlobals"));
bUseDebugTargetFromHud = false;
PredictTargetGameplayEffects = true;
ReplicateActivationOwnedTags = true;
MinimalReplicationTagCountBits = 5;
#Loc: <Workspace>/Engine/Plugins/Runtime/GameplayAbilities/Source/GameplayAbilities/Public/AbilitySystemGlobals.h:178
Scope (from outer to inner):
file
class class UAbilitySystemGlobals : public UObject
Source code excerpt:
/** Set to true if you want the "ShowDebug AbilitySystem" cheat to use the hud's debug target instead of the ability system's debug target. */
UPROPERTY(config)
bool bUseDebugTargetFromHud;
/** Helper functions for applying global scaling to various ability system tasks. This isn't meant to be a shipping feature, but to help with debugging and interation via cvar AbilitySystem.GlobalAbilityScale */
static void NonShipping_ApplyGlobalAbilityScaler_Rate(float& Rate);
static void NonShipping_ApplyGlobalAbilityScaler_Duration(float& Duration);
// Global Tags