UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PlayerController.cpp File Reference
#include "GameFramework/PlayerController.h"
#include "Engine/GameInstance.h"
#include "Engine/GameViewportClient.h"
#include "Materials/MaterialInterface.h"
#include "GameFramework/CheatManagerDefines.h"
#include "Misc/PackageName.h"
#include "GameFramework/ForceFeedbackEffect.h"
#include "TimerManager.h"
#include "Physics/Experimental/PhysScene_Chaos.h"
#include "SceneView.h"
#include "Camera/CameraActor.h"
#include "UObject/Package.h"
#include "EngineStats.h"
#include "Engine/Canvas.h"
#include "GameFramework/PlayerStart.h"
#include "Components/SkeletalMeshComponent.h"
#include "Components/AudioComponent.h"
#include "Components/ForceFeedbackComponent.h"
#include "Kismet/GameplayStatics.h"
#include "Engine/Engine.h"
#include "Engine/LevelStreaming.h"
#include "Engine/LocalPlayer.h"
#include "Engine/NetConnection.h"
#include "ContentStreaming.h"
#include "DrawDebugHelpers.h"
#include "EngineUtils.h"
#include "Framework/Application/SlateApplication.h"
#include "Framework/Application/SlateUser.h"
#include "Widgets/SViewport.h"
#include "Engine/Console.h"
#include "Net/UnrealNetwork.h"
#include "Net/Core/Misc/NetConditionGroupManager.h"
#include "Net/Core/PushModel/PushModel.h"
#include "Engine/WorldComposition.h"
#include "Engine/LevelScriptActor.h"
#include "GameFramework/GameNetworkManager.h"
#include "Interfaces/NetworkPredictionInterface.h"
#include "Net/OnlineEngineInterface.h"
#include "GameFramework/OnlineSession.h"
#include "IHeadMountedDisplay.h"
#include "IXRTrackingSystem.h"
#include "IXRCamera.h"
#include "LegacyIXRInput.h"
#include "GameFramework/TouchInterface.h"
#include "DisplayDebugHelpers.h"
#include "MoviePlayerProxy.h"
#include "GameFramework/PawnMovementComponent.h"
#include "GameFramework/SpectatorPawn.h"
#include "GameFramework/HUD.h"
#include "Engine/InputDelegateBinding.h"
#include "Widgets/Input/SVirtualJoystick.h"
#include "GameFramework/LocalMessage.h"
#include "GameFramework/CheatManager.h"
#include "GameFramework/InputSettings.h"
#include "GameFramework/PlayerState.h"
#include "GameFramework/GameStateBase.h"
#include "Haptics/HapticFeedbackEffect_Base.h"
#include "Engine/ChildConnection.h"
#include "VisualLogger/VisualLogger.h"
#include "Slate/SceneViewport.h"
#include "Engine/NetworkObjectList.h"
#include "GameFramework/GameSession.h"
#include "GameMapsSettings.h"
#include "Particles/EmitterCameraLensEffectBase.h"
#include "LevelUtils.h"
#include "WorldPartition/WorldPartitionSubsystem.h"
#include "PBDRigidsSolver.h"
#include "PhysicsEngine/PhysicsSettings.h"
#include "Iris/ReplicationSystem/ReplicationSystem.h"
#include "Net/Iris/ReplicationSystem/EngineReplicationBridge.h"
#include "Net/Iris/ReplicationSystem/ReplicationSystemUtil.h"

Classes

struct  FForceFeedbackEffectHistoryEntry
 

Namespaces

namespace  UE
 
namespace  UE::Gameplay
 
namespace  UE::Gameplay::CVars
 
namespace  NetworkPhysicsCvars
 

Macros

#define LOCTEXT_NAMESPACE   "PlayerController"
 

Functions

 DEFINE_LOG_CATEGORY (LogPlayerController)
 
 DECLARE_CYCLE_STAT (TEXT("PC Tick Actor"), STAT_PC_TickActor, STATGROUP_PlayerController)
 
 DECLARE_CYCLE_STAT (TEXT("PC Tick Input"), STAT_PC_TickInput, STATGROUP_PlayerController)
 
 DECLARE_CYCLE_STAT (TEXT("PC Build Input Stack"), STAT_PC_BuildInputStack, STATGROUP_PlayerController)
 
 DECLARE_CYCLE_STAT (TEXT("PC Process Input Stack"), STAT_PC_ProcessInputStack, STATGROUP_PlayerController)
 

Variables

int32 UE::Gameplay::CVars::NetResetServerPredictionDataOnPawnAck = 1
 
int32 UE::Gameplay::CVars::ForceUsingCameraAsStreamingSource = 0
 
bool UE::Gameplay::CVars::bIsPlayerControllerPushBased = false
 
bool UE::Gameplay::CVars::bSortInputStackByPriority = true
 
int32 NetworkPhysicsCvars::EnableDebugRPC = 1
 
int32 NetworkPhysicsCvars::TickOffsetUpdateIntervalTime = 100
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTickOffsetUpdateIntervalTime (TEXT("np2.TickOffsetUpdateIntervalTime"), TickOffsetUpdateIntervalTime, TEXT("Value in milliseconds, default 100. How long time between syncing the tick offset between client and server. Deactivate syncing by setting value 0."))
 
int32 NetworkPhysicsCvars::TickOffsetBufferTime = 90
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTickOffsetBufferTime (TEXT("np2.TickOffsetBufferTime"), TickOffsetBufferTime, TEXT("Value in milliseconds, default 60. Additional offset to be added to the local to server offset used by network prediction, this results in a buffer server-side for incoming data that uses the client/server physics offset."))
 
int32 NetworkPhysicsCvars::TickOffsetCorrectionSizeTimeLimit = 2000
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTickOffsetCorrectionSizeTimeLimit (TEXT("np2.TickOffsetCorrectionSizeTimeLimit"), TickOffsetCorrectionSizeTimeLimit, TEXT("Value in milliseconds. Note: Keep this equal to or larger than np2.TickOffsetBufferTime. If the client gets out of sync with physics ticks and the desync is larger than this value, reset the offset."))
 
int32 NetworkPhysicsCvars::TickOffsetCorrectionTimeLimit = 5000
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTickOffsetCorrectionTimeLimit (TEXT("np2.TickOffsetCorrectionTimeLimit"), TickOffsetCorrectionTimeLimit, TEXT("Value in milliseconds. If the client gets out of sync with physics ticks and can't get in sync again for this amount of time, reset the offset."))
 
float NetworkPhysicsCvars::TimeDilationAmount = 0.025f
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTimeDilationAmount (TEXT("np2.TimeDilationAmount"), TimeDilationAmount, TEXT("Server-side CVar, Disable TimeDilation by setting to 0 | Value is in percent where 0.01 = 1% dilation. Example: 1.0/0.01 = 100, meaning that over the time it usually takes to tick 100 physics steps we will tick 99 or 101 depending on if we dilate up or down."))
 
bool NetworkPhysicsCvars::TimeDilationEscalation = true
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTimeDilationEscalation (TEXT("np2.TimeDilationEscalation"), TimeDilationEscalation, TEXT("Server-side CVar, Dilate the time more depending on how many ticks we need to adjust. When set to false we use the set TimeDilationAmount and wait the amount of time it takes to perform correct the offset. When set to true we multiply the TimeDilationAmount with the buffer offset count which will correct the offset in one TimeDilationAmount cycle."))
 
float NetworkPhysicsCvars::TimeDilationEscalationDecay = 0.05f
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTimeDilationEscalationDecay (TEXT("np2.TimeDilationEscalationDecay"), TimeDilationEscalationDecay, TEXT("Value is a multiplier, Default: 0.05. For each escalated TimeDilation amount, also decay by this much. Disable by setting to 0."))
 
float NetworkPhysicsCvars::TimeDilationEscalationDecayMax = 0.5f
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTimeDilationEscalationDecayMax (TEXT("np2.TimeDilationEscalationDecayMax"), TimeDilationEscalationDecayMax, TEXT("Value is a multiplier, Default: 0.5. The max decay value for escalated time dilation. Lower value means higher decay."))
 
float NetworkPhysicsCvars::TimeDilationMax = 1.25f
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTimeDilationMax (TEXT("np2.TimeDilationMax"), TimeDilationMax, TEXT("Max value of the time dilation multiplier."))
 
float NetworkPhysicsCvars::TimeDilationMin = 0.75f
 
FAutoConsoleVariableRef NetworkPhysicsCvars::CVarTimeDilationMin (TEXT("np2.TimeDilationMin"), TimeDilationMin, TEXT("Min value of the time dilation multiplier"))
 
const float RetryClientRestartThrottleTime = 0.5f
 
const float RetryServerAcknowledgeThrottleTime = 0.25f
 
const float RetryServerCheckSpectatorThrottleTime = 0.25f
 
const float ForceRetryClientRestartTime = -100.0f
 

Macro Definition Documentation

◆ LOCTEXT_NAMESPACE

#define LOCTEXT_NAMESPACE   "PlayerController"

Function Documentation

◆ DECLARE_CYCLE_STAT() [1/4]

DECLARE_CYCLE_STAT ( TEXT("PC Build Input Stack" ,
STAT_PC_BuildInputStack  ,
STATGROUP_PlayerController   
)

◆ DECLARE_CYCLE_STAT() [2/4]

◆ DECLARE_CYCLE_STAT() [3/4]

DECLARE_CYCLE_STAT ( TEXT("PC Tick Actor" ,
STAT_PC_TickActor  ,
STATGROUP_PlayerController   
)

◆ DECLARE_CYCLE_STAT() [4/4]

DECLARE_CYCLE_STAT ( TEXT("PC Tick Input" ,
STAT_PC_TickInput  ,
STATGROUP_PlayerController   
)

◆ DEFINE_LOG_CATEGORY()

DEFINE_LOG_CATEGORY ( LogPlayerController  )

Variable Documentation

◆ ForceRetryClientRestartTime

const float ForceRetryClientRestartTime = -100.0f

◆ RetryClientRestartThrottleTime

const float RetryClientRestartThrottleTime = 0.5f

◆ RetryServerAcknowledgeThrottleTime

const float RetryServerAcknowledgeThrottleTime = 0.25f

◆ RetryServerCheckSpectatorThrottleTime

const float RetryServerCheckSpectatorThrottleTime = 0.25f