tick.AnimationDelaysEndGroup
tick.AnimationDelaysEndGroup
#Overview
name: tick.AnimationDelaysEndGroup
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If > 0, then skeletal meshes that do not rely on physics simulation will set their animation end tick group to TG_PostPhysics.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of tick.AnimationDelaysEndGroup is to control the timing of skeletal mesh animation updates in relation to physics simulation in Unreal Engine 5. It is primarily used for the animation system, specifically for skeletal mesh components.
This setting variable is utilized by the Engine module, particularly within the SkeletalMeshComponent class. Based on the callsites, it’s clear that this variable affects the tick group assignment for skeletal mesh components that don’t rely on physics simulation.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, but can be changed at runtime through console commands or configuration files.
The associated variable CVarAnimationDelaysEndGroup directly interacts with tick.AnimationDelaysEndGroup. They share the same value and purpose.
Developers must be aware that when this variable is set to a value greater than 0, skeletal meshes that don’t rely on physics simulation will have their animation end tick group set to TG_PostPhysics instead of the default TG_PrePhysics. This can affect the order of operations in the game loop, potentially changing the behavior of animations in relation to physics and other systems.
Best practices when using this variable include:
- Consider the implications on performance and animation-physics interactions when changing this value.
- Test thoroughly after modifying this setting, as it can affect the timing of animations across the entire game.
- Use this setting in conjunction with other animation and physics settings for optimal results.
- Document any changes to this variable in project settings or documentation to ensure team-wide awareness.
Regarding the associated variable CVarAnimationDelaysEndGroup:
The purpose of CVarAnimationDelaysEndGroup is identical to tick.AnimationDelaysEndGroup. It’s the actual C++ variable that represents the console variable in the engine’s code.
This variable is used directly in the SkeletalMeshComponent::TickComponent function to determine the end tick group for skeletal mesh components. It’s accessed using the GetValueOnGameThread() method, which retrieves the current value of the console variable.
The value of CVarAnimationDelaysEndGroup is set through the console variable system, just like tick.AnimationDelaysEndGroup.
Developers should be aware that changing CVarAnimationDelaysEndGroup at runtime will immediately affect the behavior of skeletal mesh components in the game.
Best practices for CVarAnimationDelaysEndGroup are the same as those for tick.AnimationDelaysEndGroup, as they represent the same setting within the engine.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkeletalMeshComponent.cpp:1674
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarAnimationDelaysEndGroup(
TEXT("tick.AnimationDelaysEndGroup"),
1,
TEXT("If > 0, then skeletal meshes that do not rely on physics simulation will set their animation end tick group to TG_PostPhysics."));
void USkeletalMeshComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
CSV_SCOPED_TIMING_STAT_EXCLUSIVE(Animation);
#Associated Variable and Callsites
This variable is associated with another variable named CVarAnimationDelaysEndGroup
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkeletalMeshComponent.cpp:1673
Scope: file
Source code excerpt:
}
static TAutoConsoleVariable<int32> CVarAnimationDelaysEndGroup(
TEXT("tick.AnimationDelaysEndGroup"),
1,
TEXT("If > 0, then skeletal meshes that do not rely on physics simulation will set their animation end tick group to TG_PostPhysics."));
void USkeletalMeshComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkeletalMeshComponent.cpp:1720
Scope (from outer to inner):
file
function void USkeletalMeshComponent::TickComponent
Source code excerpt:
/** Update the end group and tick priority */
const bool bDoLateEnd = CVarAnimationDelaysEndGroup.GetValueOnGameThread() > 0;
const bool bRequiresPhysics = EndPhysicsTickFunction.IsTickFunctionRegistered();
const ETickingGroup EndTickGroup = bDoLateEnd && !bRequiresPhysics ? TG_PostPhysics : TG_PrePhysics;
if (ThisTickFunction)
{
ThisTickFunction->EndTickGroup = EndTickGroup;