ts.debug.OverrideTargetingLifeTime

ts.debug.OverrideTargetingLifeTime

#Overview

name: ts.debug.OverrideTargetingLifeTime

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ts.debug.OverrideTargetingLifeTime is to override the draw lifetime for debugging purposes in the Gameplay Targeting System. This setting variable is primarily used for debugging and visualization of the targeting system.

This setting variable is part of the Gameplay Targeting System, which is an experimental plugin in Unreal Engine 5. It’s specifically used within the TargetingSubsystem module of this plugin.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0.0f and can be changed at runtime using console commands.

The associated variable OverrideTargetingLifeTime directly interacts with ts.debug.OverrideTargetingLifeTime. They share the same value, with OverrideTargetingLifeTime being the actual variable used in the code, while ts.debug.OverrideTargetingLifeTime is the console variable name used to modify it.

Developers must be aware that this variable is specifically for debugging purposes. It should not be relied upon for gameplay logic or production builds. It’s only available when ENABLE_DRAW_DEBUG is defined, which is typically only in development builds.

Best practices when using this variable include:

  1. Only use it for debugging and development purposes.
  2. Be cautious about performance impacts when enabling debug draws for extended periods.
  3. Remember to disable or reset it before creating production builds.
  4. Use it in conjunction with other debugging tools to get a comprehensive view of the targeting system’s behavior.

Regarding the associated variable OverrideTargetingLifeTime:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:68

Scope (from outer to inner):

file
namespace    TargetingSystemCVars

Source code excerpt:

	static float OverrideTargetingLifeTime = 0.f;
    FAutoConsoleVariableRef CvarOverrideTargetingLifeTime(
    	TEXT("ts.debug.OverrideTargetingLifeTime"),
    	OverrideTargetingLifeTime,
    	TEXT("Overrides the draws life time to ease the debugging")
    );

#endif // ENABLE_DRAW_DEBUG
}

#Associated Variable and Callsites

This variable is associated with another variable named OverrideTargetingLifeTime. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:66

Scope (from outer to inner):

file
namespace    TargetingSystemCVars

Source code excerpt:

	);
	
	static float OverrideTargetingLifeTime = 0.f;
    FAutoConsoleVariableRef CvarOverrideTargetingLifeTime(
    	TEXT("ts.debug.OverrideTargetingLifeTime"),
    	OverrideTargetingLifeTime,
    	TEXT("Overrides the draws life time to ease the debugging")
    );

#endif // ENABLE_DRAW_DEBUG
}

#Loc: <Workspace>/Engine/Plugins/Experimental/GameplayTargetingSystem/Source/GameplayTargetingSystem/Private/TargetingSystem/TargetingSubsystem.cpp:775

Scope (from outer to inner):

file
function     float UTargetingSubsystem::GetOverrideTargetingLifeTime

Source code excerpt:

float UTargetingSubsystem::GetOverrideTargetingLifeTime()
{
	return TargetingSystemCVars::OverrideTargetingLifeTime;
}

/* static */
void UTargetingSubsystem::OnShowDebugInfo(AHUD* HUD, UCanvas* Canvas, const FDebugDisplayInfo& DisplayInfo, float& YL, float& YPos)
{
	if (IsTargetingDebugEnabled())