Header <GameFramework/PlayerController.h>

#include "GameFramework/PlayerController.h"
Module: Engine Source: Engine/Source/Runtime/Engine/Classes/GameFramework/PlayerController.h

Includes 25

<SlateFwd.h>
<UObject/ObjectMacros.h>
<Containers/SortedMap.h>
<Containers/StaticArray.h>
<Misc/Guid.h>
<InputCoreTypes.h>
<Templates/SubclassOf.h>
<Engine/NetSerialization.h>
<Engine/EngineTypes.h>
<Engine/EngineBaseTypes.h>
<Engine/LatentActionManager.h>
<SceneTypes.h>
<GameFramework/Controller.h>
<UObject/TextProperty.h>
<GameFramework/PlayerMuteList.h>
<GameFramework/OnlineReplStructs.h>
<Camera/PlayerCameraManager.h>
<GameFramework/ForceFeedbackParameters.h>
<GameFramework/UpdateLevelVisibilityLevelInfo.h>
<GenericPlatform/ICursor.h>
<GenericPlatform/IInputInterface.h>
<Physics/AsyncPhysicsData.h>
<WorldPartition/WorldPartitionStreamingSource.h>
<EngineDefines.h>
<InputKeyEventArgs.h>

Contents

APlayerController
PlayerControllers are used by human players to control Pawns.
(uclass class : AController)

class APlayerController

class APlayerController : public AController, public IWorldPartitionStreamingSourceProviderUCLASSconfig=GameBlueprintTypeBlueprintableMinimalAPI
PlayerControllers are used by human players to control Pawns.

Constructors 1

APlayerController
APlayerController(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());
Default Constructor

Member functions 324

SetTargetViewRotation
void SetTargetViewRotation(const FRotator& InRotation);
Setter for TargetViewRotation. Marks it dirty if APlayerController is configured to use push-based dirtiness.
BeginReplication
virtual void BeginReplication() override;protected
ServerSetSpectatorWaiting
void ServerSetSpectatorWaiting(bool bWaiting);UFUNCTIONCategory=PlayerController
Indicate that the Spectator is waiting to join/respawn.
ClientSetSpectatorWaiting
void ClientSetSpectatorWaiting(bool bWaiting);UFUNCTIONCategory=PlayerController
Indicate that the Spectator is waiting to join/respawn.
SetMotionControlsEnabled
void SetMotionControlsEnabled(bool bEnabled);UFUNCTION
EnableCheats
virtual void EnableCheats();UFUNCTION
Run from the console to try and manually enable cheats which are disabled by default in multiplayer, games can override this
UnFreeze
virtual void UnFreeze();
Timer used by RoundEnded and Inactive states to accept player input again
GetMinRespawnDelay
virtual float GetMinRespawnDelay();
Calculate minimal respawn delay
FOV
virtual void FOV(float NewFOV);UFUNCTION
Set the field of view to NewFOV
RestartLevel
virtual void RestartLevel();UFUNCTION
Restarts the current level
LocalTravel
virtual void LocalTravel(const FString& URL);UFUNCTION
Causes the client to travel to the given URL
ServerExecRPC
void ServerExecRPC(const FString& Msg);UFUNCTIONReliableServer
RPC used by ServerExec. Not intended to be called directly
ServerExec
void ServerExec(const FString& Msg);UFUNCTION
Executes command on server (non shipping builds only)
ClientReturnToMainMenuWithTextReason
virtual void ClientReturnToMainMenuWithTextReason(const FText& ReturnReason);UFUNCTIONReliableClient
Return the client to the main menu gracefully
ClientRepObjRef
virtual void ClientRepObjRef(UObject* Object);UFUNCTIONReliableClient
Development RPC for testing object reference replication
SetPause
virtual bool SetPause(bool bPause, FCanUnpause CanUnpauseDelegate = FCanUnpause());
Locally try to pause game (call serverpause to pause network game); returns success indicator. Calls GameModeBase's SetPause().
Pause
virtual void Pause();UFUNCTION
Command to try to pause the game.
SetName
virtual void SetName(const FString& S);UFUNCTION
Tries to set the player's name to the given name.
SwitchLevel
virtual void SwitchLevel(const FString& URL);UFUNCTION
SwitchLevel to the given MapURL.
NotifyLoadedWorld
virtual void NotifyLoadedWorld(FName WorldPackageName, bool bFinalDest);
Called to notify the server when the client has loaded a new world via seamless traveling
PlayerTick
virtual void PlayerTick(float DeltaTime);
Processes player input (immediately after PlayerInput gets ticked) and calls UpdateRotation(). PlayerTick is only called if the PlayerController has a PlayerInput object. Therefore, it will only be called for locally…
PreProcessInput
virtual void PreProcessInput(const float DeltaTime, const bool bGamePaused);
Method called prior to processing input
PostProcessInput
virtual void PostProcessInput(const float DeltaTime, const bool bGamePaused);
Method called after processing input
SetCinematicMode
virtual void SetCinematicMode(bool bInCinematicMode, bool bAffectsMovement, bool bAffectsTurning);
virtual void SetCinematicMode(bool bInCinematicMode, bool bHidePlayer, bool bAffectsHUD, bool bAffectsMovement, bool bAffectsTurning);UFUNCTIONBlueprintCallableCategory=Game|Cinematic
Adjust input based on cinematic mode
ResetIgnoreInputFlags
virtual void ResetIgnoreInputFlags() override;
Reset move and look input ignore flags to defaults
GetHitResultAtScreenPosition
bool GetHitResultAtScreenPosition(const FVector2D ScreenPosition, const ECollisionChannel TraceChannel, const FCollisionQueryParams& CollisionQueryParams, FHitResult& HitResult) const;
bool GetHitResultAtScreenPosition(const FVector2D ScreenPosition, const ECollisionChannel TraceChannel, bool bTraceComplex, FHitResult& HitResult) const;
bool GetHitResultAtScreenPosition(const FVector2D ScreenPosition, const ETraceTypeQuery TraceChannel, bool bTraceComplex, FHitResult& HitResult) const;
bool GetHitResultAtScreenPosition(const FVector2D ScreenPosition, const TArray<TEnumAsByte<EObjectTypeQuery>> & ObjectTypes, bool bTraceComplex, FHitResult& HitResult) const;
Returns hit results from doing a collision query at a certain location on the screen
GetHitResultUnderCursorByChannel
bool GetHitResultUnderCursorByChannel(ETraceTypeQuery TraceChannel, bool bTraceComplex, FHitResult& HitResult) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Performs a collision query under the mouse cursor, looking on a trace channel
GetHitResultUnderCursorForObjects
bool GetHitResultUnderCursorForObjects(const TArray<TEnumAsByte<EObjectTypeQuery>> & ObjectTypes, bool bTraceComplex, FHitResult& HitResult) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Performs a collision query under the mouse cursor, looking for object types
GetHitResultUnderFingerByChannel
bool GetHitResultUnderFingerByChannel(ETouchIndex::Type FingerIndex, ETraceTypeQuery TraceChannel, bool bTraceComplex, FHitResult& HitResult) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Performs a collision query under the finger, looking on a trace channel
GetHitResultUnderFingerForObjects
bool GetHitResultUnderFingerForObjects(ETouchIndex::Type FingerIndex, const TArray<TEnumAsByte<EObjectTypeQuery>> & ObjectTypes, bool bTraceComplex, FHitResult& HitResult) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Performs a collision query under the finger, looking for object types
DeprojectMousePositionToWorld
bool DeprojectMousePositionToWorld(FVector& WorldLocation, FVector& WorldDirection) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Convert current mouse 2D position to World Space 3D position and direction. Returns false if unable to determine value.
DeprojectScreenPositionToWorld
bool DeprojectScreenPositionToWorld(float ScreenX, float ScreenY, FVector& WorldLocation, FVector& WorldDirection) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Convert 2D screen position to World Space 3D position and direction. Returns false if unable to determine value.
ProjectWorldLocationToScreen
bool ProjectWorldLocationToScreen(FVector WorldLocation, FVector2D& ScreenLocation, bool bPlayerViewportRelative = false) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Convert a World Space 3D position into a 2D Screen Space position.
ProjectWorldLocationToScreenWithDistance
bool ProjectWorldLocationToScreenWithDistance(FVector WorldLocation, FVector& ScreenLocation, bool bPlayerViewportRelative = false) const;
Convert a World Space 3D position into a 3D Screen Space position.
PostProcessWorldToScreen
virtual bool PostProcessWorldToScreen(FVector WorldLocation, FVector2D& ScreenLocation, bool bPlayerViewportRelative) const;
After successful world to screen projection, allows custom post-processing of the resulting ScreenLocation.
SetMouseLocation
void SetMouseLocation(const int X, const int Y);UFUNCTIONBlueprintCallableCategory=Game|Player
Positions the mouse cursor in screen space, in pixels.
UpdateRotation
virtual void UpdateRotation(float DeltaTime);
Updates the rotation of player, based on ControlRotation after RotationInput has been applied. This may then be modified by the PlayerCamera, and is passed to Pawn->FaceRotation().
IsStreamingSourceEnabled
virtual bool IsStreamingSourceEnabled() const;UFUNCTIONBlueprintCallableCategory=WorldPartition
Whether the PlayerController should be used as a World Partiton streaming source. Default implementation returns bEnableStreamingSource but can be overriden in child classes.
StreamingSourceShouldActivate
virtual bool StreamingSourceShouldActivate() const;UFUNCTIONBlueprintCallableCategory=WorldPartition
Whether the PlayerController streaming source should activate cells after loading. Default implementation returns bStreamingSourceShouldActivate but can be overriden in child classes.
StreamingSourceShouldBlockOnSlowStreaming
virtual bool StreamingSourceShouldBlockOnSlowStreaming() const;UFUNCTIONBlueprintCallableCategory=WorldPartition
Whether the PlayerController streaming source should block on slow streaming. Default implementation returns bStreamingSourceShouldBlockOnSlowStreaming but can be overriden in child classes.
GetStreamingSourcePriority
virtual EStreamingSourcePriority GetStreamingSourcePriority() const;UFUNCTIONBlueprintCallableCategory=WorldPartition
Gets the streaming source priority. Default implementation returns StreamingSourcePriority but can be overriden in child classes.
GetStreamingSourceLocationAndRotation
virtual void GetStreamingSourceLocationAndRotation(FVector& OutLocation, FRotator& OutRotation) const;UFUNCTIONBlueprintCallableCategory=WorldPartition
Gets the streaming source location and rotation. Default implementation returns APlayerController::GetPlayerViewPoint but can be overriden in child classes.
GetStreamingSourceShapes
virtual void GetStreamingSourceShapes(TArray<FStreamingSourceShape>& OutShapes) const;UFUNCTIONBlueprintCallableCategory=WorldPartition
Gets the streaming source priority. Default implementation returns StreamingSourceShapes but can be overriden in child classes.
GetStreamingSources
virtual bool GetStreamingSources(TArray<FWorldPartitionStreamingSource>& OutStreamingSources) const final;
Gets the PlayerController's streaming sources
GetStreamingSourcesInternal
virtual bool GetStreamingSourcesInternal(TArray<FWorldPartitionStreamingSource>& OutStreamingSources) const;protected
GetStreamingSource
virtual bool GetStreamingSource(FWorldPartitionStreamingSource& OutStreamingSource) const final;protected
GetStreamingSourceOwner
virtual const UObject* GetStreamingSourceOwner() const override final;protected
BeginPlayingState
virtual void BeginPlayingState();protected
Pawn has been possessed, so changing state to NAME_Playing. Start it walking and begin playing with it.
EndPlayingState
virtual void EndPlayingState();protected
Leave playing state.
HasNetOwner
virtual bool HasNetOwner() const override;protected
Overridden to return that player controllers are capable of RPCs
StartFire
virtual void StartFire(uint8 FireModeNum = 0);UFUNCTION
Fire the player's currently selected weapon with the optional firemode.
LevelStreamingStatusChanged
void LevelStreamingStatusChanged(class ULevelStreaming* LevelObject, bool bNewShouldBeLoaded, bool bNewShouldBeVisible, bool bNewShouldBlockOnLoad, int32 LODIndex);
void LevelStreamingStatusChanged(class ULevelStreaming* LevelObject, bool bNewShouldBeLoaded, bool bNewShouldBeVisible, bool bNewShouldBlockOnLoad, bool bNewShouldBlockOnUnload, int32 LODIndex);
Notify player of change to level
DelayedPrepareMapChange
virtual void DelayedPrepareMapChange();
Used to wait until a map change can be prepared when one was already in progress
GetSeamlessTravelActorList
virtual void GetSeamlessTravelActorList(bool bToEntry, TArray<class AActor*>& ActorList);
Called on client during seamless level transitions to get the list of Actors that should be moved into the new level PlayerControllers, Role < ROLE_Authority Actors, and any non-Actors that are inside an Actor that…
SeamlessTravelTo
virtual void SeamlessTravelTo(class APlayerController* NewPC);
Called when seamless traveling and we are being replaced by the specified PC clean up any persistent state (post process chains on LocalPlayers, for example) (not called if PlayerController is the same for the from…
SeamlessTravelFrom
virtual void SeamlessTravelFrom(class APlayerController* OldPC);
Called when seamless traveling and the specified PC is being replaced by this one copy over data that should persist (not called if PlayerController is the same for the from and to GameModes)
PostSeamlessTravel
virtual void PostSeamlessTravel();
Called after this player controller has transitioned through seamless travel, but before that player is initialized This is called both when a new player controller is created, and when it is maintained
OnAddedToPlayerControllerList
void OnAddedToPlayerControllerList();
Called when player controller gets added to its owning world player controller list.
OnRemovedFromPlayerControllerList
void OnRemovedFromPlayerControllerList();
Called when player controller gets removed from its owning world player controller list.
ClientEnableNetworkVoice
virtual void ClientEnableNetworkVoice(bool bEnable);UFUNCTIONReliableClient
Tell the client to enable or disable voice chat (not muting)
StartTalking
void StartTalking();
Enable voice chat transmission
StopTalking
void StopTalking();
Disable voice chat transmission
ToggleSpeaking
virtual void ToggleSpeaking(bool bInSpeaking);UFUNCTION
Toggle voice chat on and off
ClientVoiceHandshakeComplete
virtual void ClientVoiceHandshakeComplete();UFUNCTIONReliableClient
Tells the client that the server has all the information it needs and that it is ok to start sending voice packets. The server will already send voice packets when this function is called, since it is set server side…
ServerMutePlayer
virtual void ServerMutePlayer(FUniqueNetIdRepl PlayerId);UFUNCTION
Tell the server to mute a player for this controller
ServerUnmutePlayer
virtual void ServerUnmutePlayer(FUniqueNetIdRepl PlayerId);UFUNCTION
Tell the server to unmute a player for this controller
ClientMutePlayer
virtual void ClientMutePlayer(FUniqueNetIdRepl PlayerId);UFUNCTIONReliableClient
Tell the client to mute a player for this controller
ClientUnmutePlayer
virtual void ClientUnmutePlayer(FUniqueNetIdRepl PlayerId);UFUNCTIONReliableClient
Tell the client to unmute a player for this controller
ServerBlockPlayer
virtual void ServerBlockPlayer(FUniqueNetIdRepl PlayerId);UFUNCTION
Tell the client to block a player for this controller
ServerUnblockPlayer
virtual void ServerUnblockPlayer(FUniqueNetIdRepl PlayerId);UFUNCTION
Tell the client to unblock a player for this controller
ClientUnmutePlayers
virtual void ClientUnmutePlayers(const TArray<FUniqueNetIdRepl>& PlayerIds);UFUNCTIONReliableClient
Tell the client to unmute an array of players for this controller
GameplayMutePlayer
void GameplayMutePlayer(const FUniqueNetIdRepl& PlayerNetId);
Mutes a remote player on the server and then tells the client to mute
GameplayUnmutePlayer
void GameplayUnmutePlayer(const FUniqueNetIdRepl& PlayerNetId);
Unmutes a remote player on the server and then tells the client to unmute
GameplayUnmuteAllPlayers
void GameplayUnmuteAllPlayers();
Unmutes all remote players muted due to gameplay rules on the server and then tells the client to unmute
GetPlayerControllerForMuting
virtual class APlayerController* GetPlayerControllerForMuting(const FUniqueNetIdRepl& PlayerNetId);
Get a remote player controller on the server for muting
IsPlayerMuted
virtual bool IsPlayerMuted(const class FUniqueNetId& PlayerId);
Is the specified player muted by this controlling player for any reason (gameplay, system, etc), check voice interface IsMuted() for system mutes
ConsoleKey
virtual void ConsoleKey(FKey Key);UFUNCTION
Console control commands, useful when remote debugging so you can't touch the console the normal way
SendToConsole
virtual void SendToConsole(const FString& Command);UFUNCTION
Sends a command to the console to execute if not shipping version
ClientAddTextureStreamingLoc
void ClientAddTextureStreamingLoc(FVector InLoc, float Duration, bool bOverrideLocation);UFUNCTION
Adds a location to the texture streaming system for the specified duration.
ClientCancelPendingMapChange
void ClientCancelPendingMapChange();UFUNCTIONReliableClient
Tells client to cancel any pending map change.
ClientCapBandwidth
void ClientCapBandwidth(int32 Cap);UFUNCTIONReliableClient
Set CurrentNetSpeed to the lower of its current value and Cap.
ClientCommitMapChange
void ClientCommitMapChange();UFUNCTIONReliableClient
Actually performs the level transition prepared by PrepareMapChange().
ClientFlushLevelStreaming
void ClientFlushLevelStreaming();UFUNCTION
Tells the client to block until all pending level streaming actions are complete happens at the end of the tick primarily used to force update the client ASAP at join time
ClientForceGarbageCollection
void ClientForceGarbageCollection();UFUNCTIONReliableClient
Forces GC at the end of the tick on the client
ClientGameEnded
void ClientGameEnded(class AActor* EndGameFocus, bool bIsWinner);UFUNCTIONReliableClient
Replicated function called by GameHasEnded().
ClientGotoState
void ClientGotoState(FName NewState);UFUNCTIONReliableClient
Server uses this to force client into NewState .
ClientIgnoreLookInput
void ClientIgnoreLookInput(bool bIgnore);UFUNCTIONReliableClient
Calls IgnoreLookInput on client
ClientIgnoreMoveInput
void ClientIgnoreMoveInput(bool bIgnore);UFUNCTIONReliableClient
Calls IgnoreMoveInput on client
ClientMessage
void ClientMessage(const FString& S, FName Type = NAME_None, float MsgLifeTime = 0.f);UFUNCTIONReliableClient
Outputs a message to HUD
ClientStartCameraShake
void ClientStartCameraShake(TSubclassOf<class UCameraShakeBase> Shake, float Scale = 1.f, ECameraShakePlaySpace PlaySpace = ECameraShakePlaySpace::CameraLocal, FRotator UserPlaySpaceRot = FRotator::ZeroRotator);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Play Camera Shake
ClientStartCameraShakeFromSource
void ClientStartCameraShakeFromSource(TSubclassOf<class UCameraShakeBase> Shake, class UCameraShakeSourceComponent* SourceComponent);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Play Camera Shake localized to a given source
ClientPlaySound
void ClientPlaySound(class USoundBase* Sound, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f);UFUNCTION
Play sound client-side (so only the client will hear it)
ClientPlaySoundAtLocation
void ClientPlaySoundAtLocation(class USoundBase* Sound, FVector Location, float VolumeMultiplier = 1.f, float PitchMultiplier = 1.f);UFUNCTION
Play sound client-side at the specified location
ClientPrepareMapChange
void ClientPrepareMapChange(FName LevelName, bool bFirst, bool bLast);UFUNCTIONReliableClient
Asynchronously loads the given level in preparation for a streaming map transition. the server sends one function per level name since dynamic arrays can't be replicated
ClientPrestreamTextures
void ClientPrestreamTextures(class AActor* ForcedActor, float ForceDuration, bool bEnableStreaming, int32 CinematicTextureGroups = 0);UFUNCTIONReliableClient
Forces the streaming system to disregard the normal logic for the specified duration and instead always load all mip-levels for all textures used by the specified actor.
ClientReset
void ClientReset();UFUNCTIONReliableClient
Tell client to reset the PlayerController
ClientRestart
void ClientRestart(class APawn* NewPawn);UFUNCTIONReliableClient
Tell client to restart the level
ClientSetBlockOnAsyncLoading
void ClientSetBlockOnAsyncLoading();UFUNCTIONReliableClient
Tells the client to block until all pending level streaming actions are complete. Happens at the end of the tick primarily used to force update the client ASAP at join time.
ClientSetCameraFade
void ClientSetCameraFade(bool bEnableFading, FColor FadeColor = FColor(ForceInit), FVector2D FadeAlpha = FVector2D(-1.0f, 0.0f), float FadeTime = 0, bool bFadeAudio = false, bool bHoldWhenFinished = false);UFUNCTIONReliableClient
Tell client to fade camera
ClientSetCameraMode
void ClientSetCameraMode(FName NewCamMode);UFUNCTIONReliableClient
Replicated function to set camera style on client
ClientSetCinematicMode
void ClientSetCinematicMode(bool bInCinematicMode, bool bAffectsMovement, bool bAffectsTurning, bool bAffectsHUD);UFUNCTIONReliableClient
Called by the server to synchronize cinematic transitions with the client
ClientSetForceMipLevelsToBeResident
void ClientSetForceMipLevelsToBeResident(class UMaterialInterface* Material, float ForceDuration, int32 CinematicTextureGroups = 0);UFUNCTIONReliableClient
Forces the streaming system to disregard the normal logic for the specified duration and instead always load all mip-levels for all textures used by the specified material.
ClientSetHUD
void ClientSetHUD(TSubclassOf<AHUD> NewHUDClass);UFUNCTIONBlueprintCallableCategory=HUDReliableClient
Set the client's class of HUD and spawns a new instance of it. If there was already a HUD active, it is destroyed.
GetViewportSize
void GetViewportSize(int32& SizeX, int32& SizeY) const;UFUNCTIONBlueprintCallableCategory=HUD
Helper to get the size of the HUD canvas for this player controller. Returns 0 if there is no HUD
GetHUD
AHUD* GetHUD() const;UFUNCTIONBlueprintCallableCategory=HUD
template<class T> T* GetHUD() const;
Gets the HUD currently being used by this player controller
SetMouseCursorWidget
void SetMouseCursorWidget(EMouseCursor::Type Cursor, UPARAM(Required) class UUserWidget* CursorWidget);UFUNCTIONBlueprintCallableCategory=Game|Player
Sets the Widget for the Mouse Cursor to display
ClientSetViewTarget
void ClientSetViewTarget(class AActor* A, struct FViewTargetTransitionParams TransitionParams = FViewTargetTransitionParams());UFUNCTIONReliableClient
Set the view target
ClientSpawnGenericCameraLensEffect
void ClientSpawnGenericCameraLensEffect(UPARAM(meta=(MustImplement ="CameraLensEffectInterface")) TSubclassOf<class AActor> LensEffectEmitterClass);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Spawn a camera lens effect (e.g. blood).
ClientClearCameraLensEffects
virtual void ClientClearCameraLensEffects();UFUNCTIONBlueprintCallableCategory=Game|Feedback
Removes all Camera Lens Effects.
ClientStopCameraShake
void ClientStopCameraShake(TSubclassOf<class UCameraShakeBase> Shake, bool bImmediately = true);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Stop camera shake on client.
ClientStopCameraShakesFromSource
void ClientStopCameraShakesFromSource(class UCameraShakeSourceComponent* SourceComponent, bool bImmediately = true);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Stop camera shake on client.
K2_ClientPlayForceFeedback
void K2_ClientPlayForceFeedback(class UForceFeedbackEffect* ForceFeedbackEffect, FName Tag, bool bLooping, bool bIgnoreTimeDilation, bool bPlayWhilePaused);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Play a force feedback pattern on the player's controller
ClientPlayForceFeedback
void ClientPlayForceFeedback(class UForceFeedbackEffect* ForceFeedbackEffect, FForceFeedbackParameters Params = FForceFeedbackParameters());
Play a force feedback pattern on the player's controller
ClientStopForceFeedback
void ClientStopForceFeedback(class UForceFeedbackEffect* ForceFeedbackEffect, FName Tag);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Stops a playing force feedback pattern
PlayDynamicForceFeedback
void PlayDynamicForceFeedback(float Intensity, float Duration, bool bAffectsLeftLarge, bool bAffectsLeftSmall, bool bAffectsRightLarge, bool bAffectsRightSmall, TEnumAsByte<EDynamicForceFeedbackAction::Type> Action, FLatentActionInfo LatentInfo);UFUNCTIONBlueprintCallableCategory=Game|Feedback
FDynamicForceFeedbackHandle PlayDynamicForceFeedback(float Intensity, float Duration, bool bAffectsLeftLarge, bool bAffectsLeftSmall, bool bAffectsRightLarge, bool bAffectsRightSmall, EDynamicForceFeedbackAction::Type Action = EDynamicForceFeedbackAction::Start, FDynamicForceFeedbackHandle ActionHandle = 0);
Latent action that controls the playing of force feedback Begins playing when Start is called. Calling Update or Stop if the feedback is not active will have no effect. Completed will execute when Stop is called or…
PlayHapticEffect
void PlayHapticEffect(class UHapticFeedbackEffect_Base* HapticEffect, EControllerHand Hand, float Scale = 1.f, bool bLoop = false);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Play a haptic feedback curve on the player's controller
StopHapticEffect
void StopHapticEffect(EControllerHand Hand);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Stops a playing haptic feedback curve
SetHapticsByValue
void SetHapticsByValue(const float Frequency, const float Amplitude, EControllerHand Hand);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Sets the value of the haptics for the specified hand directly, using frequency and amplitude. NOTE: If a curve is already playing for this hand, it will be cancelled in favour of the specified values.
SetDisableHaptics
virtual void SetDisableHaptics(bool bNewDisabled);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Allows the player controller to disable all haptic requests from being fired, e.g. in the case of a level loading
SetControllerLightColor
void SetControllerLightColor(FColor Color);UFUNCTIONBlueprintCallableCategory=Game|Feedback
Sets the light color of the player's controller
ResetControllerLightColor
void ResetControllerLightColor();UFUNCTIONBlueprintCallableCategory=Game|Feedback
Resets the light color of the player's controller to default
SetControllerDeadZones
void SetControllerDeadZones(const float LeftDeadZone, const float RightDeadZone);UFUNCTIONBlueprintCallableCategory=Input
Sets the deadzones of the player's controller
ResetControllerDeadZones
void ResetControllerDeadZones();UFUNCTIONBlueprintCallableCategory=Input
Resets the player's controller deadzones to default
SetControllerTriggerReleaseThresholds
void SetControllerTriggerReleaseThresholds(const float LeftThreshold, const float RightThreshold);UFUNCTIONBlueprintCallableCategory=Input
Sets the trigger release thresholds of the player's controller
ResetControllerTriggerReleaseThresholds
void ResetControllerTriggerReleaseThresholds();UFUNCTIONBlueprintCallableCategory=Input
Resets the player's controller trigger release thresholds to default
SetControllerGyroAutoCalibration
void SetControllerGyroAutoCalibration(bool bEnabled);UFUNCTIONBlueprintCallableCategory=Input
Sets whether the player's controller's gyro auto calibration is enabled
ClientTravel
void ClientTravel(const FString& URL, enum ETravelType TravelType, bool bSeamless = false, FGuid MapPackageGuid = FGuid());UFUNCTION
Travel to a different map or IP address. Calls the PreClientTravel event before doing anything. NOTE: This is implemented as a locally executed wrapper for ClientTravelInternal, to avoid API compatability breakage
ClientTravelInternal
void ClientTravelInternal(const FString& URL, enum ETravelType TravelType, bool bSeamless = false, FGuid MapPackageGuid = FGuid());UFUNCTIONReliableClient
Internal clientside implementation of ClientTravel - use ClientTravel to call this
ClientUpdateLevelStreamingStatus
void ClientUpdateLevelStreamingStatus(FName PackageName, bool bNewShouldBeLoaded, bool bNewShouldBeVisible, bool bNewShouldBlockOnLoad, int32 LODIndex, FNetLevelVisibilityTransactionId TransactionId = FNetLevelVisibilityTransactionId(), bool bNewShouldBlockOnUnload = false);UFUNCTIONReliableClient
Replicated Update streaming status
ClientUpdateMultipleLevelsStreamingStatus
void ClientUpdateMultipleLevelsStreamingStatus(const TArray<FUpdateLevelStreamingLevelStatus>& LevelStatuses);UFUNCTIONReliableClient
Replicated Update streaming status. This version allows for the streaming state of many levels to be sent in a single RPC.
ClientWasKicked
void ClientWasKicked(const FText& KickReason);UFUNCTIONReliableClient
Notify client they were kicked from the server
ClientStartOnlineSession
void ClientStartOnlineSession();UFUNCTIONReliableClient
Notify client that the session is starting
ClientEndOnlineSession
void ClientEndOnlineSession();UFUNCTIONReliableClient
Notify client that the session is about to start
ClientRetryClientRestart
void ClientRetryClientRestart(class APawn* NewPawn);UFUNCTIONReliableClient
Assign Pawn to player, but avoid calling ClientRestart if we have already accepted this pawn
SafeRetryClientRestart
virtual void SafeRetryClientRestart();
Call ClientRetryClientRestart, but only if the current pawn is not the currently acknowledged pawn (and throttled to avoid saturating the network).
ClientReceiveLocalizedMessage
void ClientReceiveLocalizedMessage(TSubclassOf<ULocalMessage> Message, int32 Switch = 0, class APlayerState* RelatedPlayerState_1 = nullptr, class APlayerState* RelatedPlayerState_2 = nullptr, class UObject* OptionalObject = nullptr);UFUNCTIONReliableClient
send client localized message id
ServerAcknowledgePossession
void ServerAcknowledgePossession(class APawn* P);UFUNCTION
acknowledge possession of pawn
ServerCamera
void ServerCamera(FName NewMode);UFUNCTION
change mode of camera
ServerChangeName
void ServerChangeName(const FString& S);UFUNCTION
Change name of server
ServerNotifyLoadedWorld
void ServerNotifyLoadedWorld(FName WorldPackageName);UFUNCTION
Called to notify the server when the client has loaded a new world via seamless traveling
ServerPause
void ServerPause();UFUNCTION
Replicate pause request to the server
ServerRestartPlayer
void ServerRestartPlayer();UFUNCTION
Attempts to restart this player, generally called from the client upon respawn request.
ServerSetSpectatorLocation
void ServerSetSpectatorLocation(FVector NewLoc, FRotator NewRot);UFUNCTION
When spectating, updates spectator location/rotation and pings the server to make sure spectating should continue.
SafeServerUpdateSpectatorState
void SafeServerUpdateSpectatorState();
Calls ServerSetSpectatorLocation but throttles it to reduce bandwidth and only calls it when necessary.
ServerCheckClientPossession
void ServerCheckClientPossession();UFUNCTION
Tells the server to make sure the possessed pawn is in sync with the client.
ServerCheckClientPossessionReliable
void ServerCheckClientPossessionReliable();UFUNCTION
Reliable version of ServerCheckClientPossession to be used when there is no likely danger of spamming the network.
SafeServerCheckClientPossession
virtual void SafeServerCheckClientPossession();
Call ServerCheckClientPossession on the server, but only if the current pawn is not the acknowledged pawn (and throttled to avoid saturating the network).
ServerShortTimeout
void ServerShortTimeout();UFUNCTION
Notifies the server that the client has ticked gameplay code, and should no longer get the extended "still loading" timeout grace period
ServerUpdateCamera
void ServerUpdateCamera(FVector_NetQuantize CamLoc, int32 CamPitchAndYaw);UFUNCTION
If PlayerCamera.bUseClientSideCameraUpdates is set, client will replicate camera positions to the server.
ServerUpdateLevelVisibility
void ServerUpdateLevelVisibility(const FUpdateLevelVisibilityLevelInfo& LevelVisibility);UFUNCTION
Called when the client adds/removes a streamed level. The server will only replicate references to Actors in visible levels so that it's impossible to send references to Actors the client has not initialized.
ServerUpdateMultipleLevelsVisibility
void ServerUpdateMultipleLevelsVisibility(const TArray<FUpdateLevelVisibilityLevelInfo>& LevelVisibilities);UFUNCTION
Called when the client adds/removes a streamed level. This version of the function allows you to pass the state of multiple levels at once, to reduce the number of RPC events that will be sent.
ServerVerifyViewTarget
void ServerVerifyViewTarget();UFUNCTION
Used by client to request server to confirm current viewtarget (server will respond with ClientSetViewTarget() ).
ServerViewNextPlayer
void ServerViewNextPlayer();UFUNCTION
Move camera to next player on round ended or spectating
ServerViewPrevPlayer
void ServerViewPrevPlayer();UFUNCTION
Move camera to previous player on round ended or spectating
ServerViewSelf
void ServerViewSelf(struct FViewTargetTransitionParams TransitionParams = FViewTargetTransitionParams());UFUNCTION
Move camera to current user
ClientTeamMessage
void ClientTeamMessage(class APlayerState* SenderPlayerState, const FString& S, FName Type, float MsgLifeTime = 0);UFUNCTIONReliableClient
ServerToggleAILogging
void ServerToggleAILogging();UFUNCTION
Used by UGameplayDebuggingControllerComponent to replicate messages for AI debugging in network games.
AddPitchInput
virtual void AddPitchInput(float Val);UFUNCTIONBlueprintCallableCategory=Game|Player
Add Pitch (look up) input. This value is multiplied by InputPitchScale.
AddYawInput
virtual void AddYawInput(float Val);UFUNCTIONBlueprintCallableCategory=Game|Player
Add Yaw (turn) input. This value is multiplied by InputYawScale.
AddRollInput
virtual void AddRollInput(float Val);UFUNCTIONBlueprintCallableCategory=Game|Player
Add Roll input. This value is multiplied by InputRollScale.
IsInputKeyDown
bool IsInputKeyDown(FKey Key) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Returns true if the given key/button is pressed on the input of the controller (if present)
WasInputKeyJustPressed
bool WasInputKeyJustPressed(FKey Key) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Returns true if the given key/button was up last frame and down this frame.
WasInputKeyJustReleased
bool WasInputKeyJustReleased(FKey Key) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Returns true if the given key/button was down last frame and up this frame.
GetInputAnalogKeyState
float GetInputAnalogKeyState(FKey Key) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Returns the analog value for the given key/button. If analog isn't supported, returns 1 for down and 0 for up.
GetInputVectorKeyState
FVector GetInputVectorKeyState(FKey Key) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Returns the vector value for the given key/button.
GetInputTouchState
void GetInputTouchState(ETouchIndex::Type FingerIndex, float& LocationX, float& LocationY, bool& bIsCurrentlyPressed) const;UFUNCTIONBlueprintCallableCategory=Game|Player
void GetInputTouchState(ETouchIndex::Type FingerIndex, double& LocationX, double& LocationY, bool& bIsCurrentlyPressed) const;
Retrieves the X and Y screen coordinates of the specified touch key. Returns false if the touch index is not down
GetInputMotionState
void GetInputMotionState(FVector& Tilt, FVector& RotationRate, FVector& Gravity, FVector& Acceleration) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Retrieves the current motion state of the player's input device
GetMousePosition
bool GetMousePosition(float& LocationX, float& LocationY) const;UFUNCTIONBlueprintCallableCategory=Game|Player
bool GetMousePosition(double& LocationX, double& LocationY) const;
Retrieves the X and Y screen coordinates of the mouse cursor. Returns false if there is no associated mouse device
GetInputKeyTimeDown
float GetInputKeyTimeDown(FKey Key) const;UFUNCTIONBlueprintCallableCategory=Game|Player
Returns how long the given key/button has been down. Returns 0 if it's up or it just went down this frame.
GetInputMouseDelta
void GetInputMouseDelta(float& DeltaX, float& DeltaY) const;UFUNCTIONBlueprintCallableCategory=Game|Player
void GetInputMouseDelta(double& DeltaX, double& DeltaY) const;
Retrieves how far the mouse moved this frame.
GetInputAnalogStickState
void GetInputAnalogStickState(EControllerAnalogStick::Type WhichStick, float& StickX, float& StickY) const;UFUNCTIONBlueprintCallableCategory=Game|Player
void GetInputAnalogStickState(EControllerAnalogStick::Type WhichStick, double& StickX, double& StickY) const;
Retrieves the X and Y displacement of the given analog stick.
ActivateTouchInterface
virtual void ActivateTouchInterface(class UTouchInterface* NewTouchInterface);UFUNCTIONBlueprintCallableCategory=Game|Player
Activates a new touch interface for this player controller
SetVirtualJoystickVisibility
virtual void SetVirtualJoystickVisibility(bool bVisible);UFUNCTIONBlueprintCallableCategory=Game|Player
Set the virtual joystick visibility.
SetInputMode
virtual void SetInputMode(const FInputModeDataBase& InData);
Setup an input mode.
Camera
virtual void Camera(FName NewMode);UFUNCTION
Change Camera mode
SetViewTargetWithBlend
virtual void SetViewTargetWithBlend(class AActor* NewViewTarget, float BlendTime = 0, enum EViewTargetBlendFunction BlendFunc = VTBlend_Linear, float BlendExp = 0, bool bLockOutgoing = false);UFUNCTIONBlueprintCallableCategory=Game|Player
Set the view target blending with variable control
IncludeInNetConditionGroup
void IncludeInNetConditionGroup(FName NetGroup);
Make this player a member of a netcondition group. Any subobject registered in the group may now be replicated to this player's connection.
RemoveFromNetConditionGroup
void RemoveFromNetConditionGroup(FName NetGroup);
Remove this player from a netcondition group.
IsMemberOfNetConditionGroup
bool IsMemberOfNetConditionGroup(FName NetGroup) const;
Returns true if the player controller is a member of the netcondition group
GetNetConditionGroups
const TArray<FName>& GetNetConditionGroups() const;
Returns the list of netcondition groups we are part of.
SetupInactiveStateInputComponent
virtual void SetupInactiveStateInputComponent(UInputComponent* InComponent);protected
Sets up input bindings for the input component pushed on the stack in the inactive state.
UpdateStateInputComponents
virtual void UpdateStateInputComponents();protected
Refresh state specific input components
CreateVirtualJoystick
virtual TSharedPtr<class SVirtualJoystick> CreateVirtualJoystick();protected
Create virtual touch interface
PushInputComponent
virtual void PushInputComponent(UInputComponent* Input);
Adds an inputcomponent to the top of the input stack.
PopInputComponent
virtual bool PopInputComponent(UInputComponent* Input);
Removes given inputcomponent from the input stack (regardless of if it's the top, actually).
IsInputComponentInStack
virtual bool IsInputComponentInStack(const UInputComponent* Input) const;
Returns true if the given input component is in this PlayerController's CurrentInputStack
FlushPressedKeys
virtual void FlushPressedKeys();
Flushes the current key state.
ShouldFlushKeysWhenViewportFocusChanges
virtual bool ShouldFlushKeysWhenViewportFocusChanges() const;
If true, then the GameViewportClient should call FlushPressedKeys on this controller when it loses focus. The default behavior here is to return true if the PlayerController is in any input mode other than GameAndUI
GetOverridePlayerInputClass
TSubclassOf<UPlayerInput> GetOverridePlayerInputClass() const;UFUNCTIONBlueprintCallableCategory=Input
InputKey
virtual bool InputKey(const FInputKeyEventArgs& Params);
Handles a key press
InputTouch
virtual bool InputTouch(const FInputDeviceId DeviceId, uint32 Handle, ETouchType::Type Type, const FVector2D& TouchLocation, float Force, uint32 TouchpadIndex, const uint64 Timestamp);
Handles a touch screen action
InputMotion
virtual bool InputMotion(const FInputDeviceId DeviceId, const FVector& Tilt, const FVector& RotationRate, const FVector& Gravity, const FVector& Acceleration, const uint64 Timestamp);
Handles motion control
SetPlayer
virtual void SetPlayer(UPlayer* InPlayer);
Associate a new UPlayer with this PlayerController.
GetLocalPlayer
class ULocalPlayer* GetLocalPlayer() const;
Returns the ULocalPlayer for this controller if it exists, or null otherwise
GetPlatformUserId
FPlatformUserId GetPlatformUserId() const;UFUNCTIONBlueprintCallableBlueprintPureCategory=Game|Player
Returns the platform user that is assigned to this Player Controller's Local Player. If there is no local player, then this will return PLATFORMUSERID_NONE
SmoothTargetViewRotation
virtual void SmoothTargetViewRotation(APawn* TargetPawn, float DeltaSeconds);
Called client-side to smoothly interpolate received TargetViewRotation (result is in BlendedTargetViewRotation)
ConsoleCommand
virtual FString ConsoleCommand(const FString& Command, bool bWriteToLog = true);
Executes the Exec() command on the UPlayer object
PostLoad
virtual void PostLoad() override;
GetLifetimeReplicatedProps
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty> & OutLifetimeProps) const override;
PostMigrate
virtual void PostMigrate(const FUObjectMigrationContext& MigrationContext) override;
GetActorEyesViewPoint
virtual void GetActorEyesViewPoint(FVector& Location, FRotator& Rotation) const override;
CalcCamera
virtual void CalcCamera(float DeltaTime, struct FMinimalViewInfo& OutResult) override;
TickActor
virtual void TickActor(float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction) override;
IsNetRelevantFor
virtual bool IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const override;
FellOutOfWorld
virtual void FellOutOfWorld(const class UDamageType& dmgType) override;
Reset
virtual void Reset() override;
OnPossess
virtual void OnPossess(APawn* aPawn) override;protected
OnUnPossess
virtual void OnUnPossess() override;protected
CleanupPlayerState
virtual void CleanupPlayerState() override;
EndPlay
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
Destroyed
virtual void Destroyed() override;
OnActorChannelOpen
virtual void OnActorChannelOpen(class FInBunch& InBunch, class UNetConnection* Connection) override;
UseShortConnectTimeout
virtual bool UseShortConnectTimeout() const override;
OnSerializeNewActor
virtual void OnSerializeNewActor(class FOutBunch& OutBunch) override;
OnNetCleanup
virtual void OnNetCleanup(class UNetConnection* Connection) override;
GetNetPriority
virtual float GetNetPriority(const FVector& ViewPos, const FVector& ViewDir, AActor* Viewer, AActor* ViewTarget, UActorChannel* InChannel, float Time, bool bLowBandwidth) override;
GetNetOwner
virtual const AActor* GetNetOwner() const override;
GetNetOwningPlayer
virtual class UPlayer* GetNetOwningPlayer() override;
GetNetOwningPlayerAnyRole
virtual class UPlayer* GetNetOwningPlayerAnyRole() override;
GetNetConnection
virtual class UNetConnection* GetNetConnection() const override;
DestroyNetworkActorHandled
virtual bool DestroyNetworkActorHandled() override;
DisplayDebug
virtual void DisplayDebug(class UCanvas* Canvas, const FDebugDisplayInfo& DebugDisplay, float& YL, float& YPos) override;
PostInitializeComponents
virtual void PostInitializeComponents() override;
EnableInput
virtual void EnableInput(class APlayerController* PlayerController) override;
DisableInput
virtual void DisableInput(class APlayerController* PlayerController) override;
Serialize
virtual void Serialize(FArchive& Ar) override;
Tick
virtual void Tick(float DeltaTime) override;
BeginPlay
virtual void BeginPlay() override;protected
GameHasEnded
virtual void GameHasEnded(class AActor* EndGameFocus = nullptr, bool bIsWinner = false) override;
IsLocalController
virtual bool IsLocalController() const override;
GetPlayerViewPoint
virtual void GetPlayerViewPoint(FVector& out_Location, FRotator& out_Rotation) const override;
SetInitialLocationAndRotation
virtual void SetInitialLocationAndRotation(const FVector& NewLocation, const FRotator& NewRotation) override;
ChangeState
virtual void ChangeState(FName NewState) override;
GetViewTarget
virtual class AActor* GetViewTarget() const override;
BeginInactiveState
virtual void BeginInactiveState() override;
EndInactiveState
virtual void EndInactiveState() override;
FailedToSpawnPawn
virtual void FailedToSpawnPawn() override;
SetPawn
virtual void SetPawn(APawn* InPawn) override;
NotifyActorChannelFailure
virtual void NotifyActorChannelFailure(UActorChannel* ActorChan);
Called on the server when the client sends a message indicating it was unable to initialize an Actor channel, most commonly because the desired Actor's archetype couldn't be serialized the default is to do nothing…
UpdateHiddenActors
virtual void UpdateHiddenActors(const FVector& ViewLocation);
Builds a list of actors that are hidden based upon gameplay
UpdateHiddenComponents
virtual void UpdateHiddenComponents(const FVector& ViewLocation, TSet<FPrimitiveComponentId>&);
Builds a list of components that are hidden based upon gameplay
BuildHiddenComponentList
void BuildHiddenComponentList(const FVector& ViewLocation, TSet<FPrimitiveComponentId>& HiddenComponentsOut);
Builds a list of components that are hidden based upon gameplay. This calls both UpdateHiddenActors and UpdateHiddenComponents, merging the two lists.
SpawnPlayerCameraManager
virtual void SpawnPlayerCameraManager();
spawn cameras for servers and owning players
GetAudioListenerPosition
virtual void GetAudioListenerPosition(FVector& OutLocation, FVector& OutFrontDir, FVector& OutRightDir) const;
get audio listener position and orientation
GetAudioListenerAttenuationOverridePosition
virtual bool GetAudioListenerAttenuationOverridePosition(FVector& OutLocation) const;
Gets the attenuation position override.
SetAudioListenerOverride
void SetAudioListenerOverride(USceneComponent* AttachToComponent, FVector Location, FRotator Rotation);UFUNCTIONBlueprintCallableCategory=Game|Audio
Used to override the default positioning of the audio listener
ClearAudioListenerOverride
void ClearAudioListenerOverride();UFUNCTIONBlueprintCallableCategory=Game|Audio
Clear any overrides that have been applied to audio listener
SetAudioListenerAttenuationOverride
void SetAudioListenerAttenuationOverride(USceneComponent* AttachToComponent, FVector AttenuationLocationOVerride);UFUNCTIONBlueprintCallableCategory=Game|Audio
ClearAudioListenerAttenuationOverride
void ClearAudioListenerAttenuationOverride();UFUNCTIONBlueprintCallableCategory=Game|Audio
TickPlayerInput
void TickPlayerInput(const float DeltaSeconds, const bool bGamePaused);protected
Internal.
ProcessPlayerInput
virtual void ProcessPlayerInput(const float DeltaTime, const bool bGamePaused);protected
BuildInputStack
virtual void BuildInputStack(TArray<UInputComponent*>& InputStack);protected
ProcessForceFeedbackAndHaptics
void ProcessForceFeedbackAndHaptics(const float DeltaTime, const bool bGamePaused);protected
UpdateForceFeedback
virtual void UpdateForceFeedback(IInputInterface* InputInterface, const int32 ControllerId);protected
IsInViewportClient
virtual bool IsInViewportClient(UGameViewportClient* ViewportClient) const;protected
GetInputIndex
virtual int32 GetInputIndex() const;protected
GetAutoActivateCameraForPlayer
virtual ACameraActor* GetAutoActivateCameraForPlayer() const;protected
ProcessTouchHitResult
virtual void ProcessTouchHitResult(const FInputDeviceId DeviceId, uint32 Handle, ETouchType::Type Type, const FVector2D& TouchLocation, const FHitResult& HitResult, const bool bHit);protected
SetupInputComponent
virtual void SetupInputComponent();protected
Allows the PlayerController to set up custom input bindings.
SetNetSpeed
void SetNetSpeed(int32 NewSpeed);
Store the net speed
GetPlayerNetworkAddress
FString GetPlayerNetworkAddress();
Get the local players network address
GetServerNetworkAddress
FString GetServerNetworkAddress();
Get the server network address
NetworkRemapPath
FName NetworkRemapPath(FName InPackageName, bool bReading);
Handles remapping a package name for networking, call on both the client and server when sending package names manually for RPCs
CleanUpAudioComponents
virtual void CleanUpAudioComponents();
Clears out 'left-over' audio components.
AddCheats
virtual void AddCheats(bool bForce = false);
Called to try and enable cheats for this player, happens during initialization or from AllowCheats command
SpawnDefaultHUD
virtual void SpawnDefaultHUD();
Spawn a HUD (make sure that PlayerController always has valid HUD, even if ClientSetHUD() hasn't been called
CreateTouchInterface
virtual void CreateTouchInterface();
Create the touch interface, and activate an initial touch interface (if touch interface is desired)
CleanupGameViewport
virtual void CleanupGameViewport();
Gives the PlayerController an opportunity to cleanup any changes it applied to the game viewport, primarily for the touch interface
AcknowledgePossession
virtual void AcknowledgePossession(class APawn* P);
Called on the client to do local pawn setup after possession, before calling ServerAcknowledgePossession
PawnLeavingGame
virtual void PawnLeavingGame();
Clean up when a Pawn's player is leaving a game. Base implementation destroys the pawn.
UpdatePing
virtual void UpdatePing(float InPing);
Takes ping updates from the net driver (both clientside and serverside), and passes them on to PlayerState::UpdatePing
GetNextViewablePlayer
virtual class APlayerState* GetNextViewablePlayer(int32 dir);
Get next active viewable player in PlayerArray.
ViewAPlayer
virtual void ViewAPlayer(int32 dir);
View next active player in PlayerArray.
CanRestartPlayer
virtual bool CanRestartPlayer();UFUNCTIONBlueprintCallableCategory=Game|Player
Returns true if this controller thinks it's able to restart. Called from GameModeBase::PlayerCanRestart
IsSplitscreenPlayer
bool IsSplitscreenPlayer(int32* OutSplitscreenPlayerIndex = nullptr) const;
Determines whether this player is playing split-screen.
IsPrimaryPlayer
bool IsPrimaryPlayer() const;UFUNCTIONBlueprintPureCategory=Game|Player
Wrapper for determining whether this player is the first player on their console.
GetSplitscreenPlayerByIndex
class APlayerState* GetSplitscreenPlayerByIndex(int32 PlayerIndex = 1) const;
Returns the PlayerState associated with the player at the specified index.
GetSplitscreenPlayerCount
int32 GetSplitscreenPlayerCount() const;
Returns the number of split-screen players playing on this player's machine.
UpdateCameraManager
virtual void UpdateCameraManager(float DeltaSeconds);
Update the camera manager; this is called after all actors have been ticked.
ReceivedGameModeClass
virtual void ReceivedGameModeClass(TSubclassOf<class AGameModeBase> GameModeClass);
This function will be called to notify the player controller that the world has received its game class. In the case of a client we need to initialize the Input System here.
NotifyServerReceivedClientData
virtual bool NotifyServerReceivedClientData(APawn* InPawn, float TimeStamp);
Notify the server that client data was received on the Pawn.
StartSpectatingOnly
virtual void StartSpectatingOnly();
Start spectating mode, as the only mode allowed.
DefaultCanUnpause
virtual bool DefaultCanUnpause();
Default implementation of pausing check for 'CanUnpause' delegates
IsPaused
bool IsPaused() const;
Returns true if game is currently paused.
InputEnabled
bool InputEnabled() const;
ShouldPerformFullTickWhenPaused
bool ShouldPerformFullTickWhenPaused() const;
Returns true if we fully tick when paused (and if our tick function is enabled when paused).
HasClientLoadedCurrentWorld
bool HasClientLoadedCurrentWorld();
returns whether the client has completely loaded the server's current world (valid on server only)
SetViewTarget
virtual void SetViewTarget(class AActor* NewViewTarget, FViewTargetTransitionParams TransitionParams = FViewTargetTransitionParams());
Set the view target
AutoManageActiveCameraTarget
virtual void AutoManageActiveCameraTarget(AActor* SuggestedTarget);
If bAutoManageActiveCameraTarget is true, then automatically manage the active camera target. If there a CameraActor placed in the level with an auto-activate player assigned to it, that will be preferred, otherwise…
OnServerStartedVisualLogger
void OnServerStartedVisualLogger(bool bIsLogging);UFUNCTIONReliableClient
Notify from server that Visual Logger is recording, to show that information on client about possible performance issues
SetShowMouseCursor
void SetShowMouseCursor(bool bShow);
ShouldShowMouseCursor
virtual bool ShouldShowMouseCursor() const;
Returns true if the mouse cursor should be shown
GetMouseCursor
virtual EMouseCursor::Type GetMouseCursor() const;
Returns the current mouse cursor, or None
GetSpectatorPawn
ASpectatorPawn* GetSpectatorPawn() const;UFUNCTIONBlueprintCallableCategory=Pawn
Spectating Get the Pawn used when spectating. nullptr when not spectating.
GetPawnOrSpectator
APawn* GetPawnOrSpectator() const;
Returns the first of GetPawn() or GetSpectatorPawn() that is not nullptr, or nullptr otherwise.
ReceivedSpectatorClass
virtual void ReceivedSpectatorClass(TSubclassOf<ASpectatorPawn> SpectatorClass);
Called to notify the controller that the spectator class has been received.
GetFocalLocation
virtual FVector GetFocalLocation() const;UFUNCTIONBlueprintCallableCategory=Pawn
Returns the location the PlayerController is focused on. If there is a possessed Pawn, returns the Pawn's location. If there is a spectator Pawn, returns that Pawn's location. Otherwise, returns the…
BeginSpectatingState
virtual void BeginSpectatingState();protected
Event when spectating begins.
EndSpectatingState
virtual void EndSpectatingState();protected
Event when no longer spectating.
SetSpectatorPawn
virtual void SetSpectatorPawn(ASpectatorPawn* NewSpectatorPawn);protected
Set the spectator pawn. Will also call AttachToPawn() using the new spectator.
SpawnSpectatorPawn
virtual ASpectatorPawn* SpawnSpectatorPawn();protected
Spawn a SpectatorPawn to use as a spectator and initialize it. By default it is spawned at the PC's current location and rotation.
DestroySpectatorPawn
virtual void DestroySpectatorPawn();protected
Destroys the SpectatorPawn and sets it to nullptr.
ShouldKeepCurrentPawnUponSpectating
virtual bool ShouldKeepCurrentPawnUponSpectating() const;protected
Useful to spectate other pawn without un-possessing the current pawn
SetSpawnLocation
virtual void SetSpawnLocation(const FVector& NewLocation);protected
Set the SpawnLocation for use when changing states or when there is no pawn or spectator.
GetSpawnLocation
FVector GetSpawnLocation() const;
Get the location used when initially created, or when changing states when there is no pawn or spectator.
ReceivedPlayer
virtual void ReceivedPlayer();
Called after this PlayerController's viewport/net connection is associated with this player controller.
InitInputSystem
virtual void InitInputSystem();
Spawn the appropriate class of PlayerInput. Only called for playercontrollers that belong to local players.
IsFrozen
virtual bool IsFrozen();
Returns true if input should be frozen (whether UnFreeze timer is active)
PreClientTravel
virtual void PreClientTravel(const FString& PendingURL, ETravelType TravelType, bool bIsSeamlessTravel);
Called when the local player is about to travel to a new map or IP address. Provides subclass with an opportunity to perform cleanup or other tasks prior to the travel.
SetCameraMode
virtual void SetCameraMode(FName NewCamMode);
Set new camera mode
ResetCameraMode
virtual void ResetCameraMode();
Reset Camera Mode to default.
SendClientAdjustment
virtual void SendClientAdjustment();
Called on server at end of tick, to let client Pawns handle updates from the server. Done this way to avoid ever sending more than one ClientAdjustment per server tick.
SetAsLocalPlayerController
void SetAsLocalPlayerController();
Designate this player controller as local (public for GameModeBase to use, not expected to be called anywhere else)
ShouldParticipateInSeamlessTravel
virtual bool ShouldParticipateInSeamlessTravel() const override;
Whether this controller should persist through seamless travel Player controllers should always be included in seamless travel
GetCurrentInputModeDebugString
const FString& GetCurrentInputModeDebugString() const;
Keep track of the current input mode debug string here. Set in APlayerController::SetInputMode
UpdateServerAsyncPhysicsTickOffset
void UpdateServerAsyncPhysicsTickOffset();
Update the tick offset in between the local client and the server
ServerSendLatestAsyncPhysicsTimestamp
void ServerSendLatestAsyncPhysicsTimestamp(FAsyncPhysicsTimestamp Timestamp);UFUNCTIONServerUnreliable
Server receives the clients FAsyncPhysicsTimestamp with its predicted ServerFrame and clients LocalFrame, to updates the time dilation needed to keep the ServerFrame prediction in sync
ClientSetupNetworkPhysicsTimestamp
void ClientSetupNetworkPhysicsTimestamp(FAsyncPhysicsTimestamp Timestamp);UFUNCTIONClientReliable
Client receives the setup of the FAsyncPhysicsTimestamp ServerFrame and LocalFrame offset from the server.
ExecuteAsyncPhysicsCommand
void ExecuteAsyncPhysicsCommand(const FAsyncPhysicsTimestamp& AsyncPhysicsTimestamp, UObject* OwningObject, const TFunction<void()>& Command, const bool bEnableResim = true);
Enqueues a command to run at the time specified by AsyncPhysicsTimestamp. Note that if the time specified was missed the command is triggered as soon as possible as part of the async tick. These commands are all run…
GetPhysicsTimestamp
FAsyncPhysicsTimestamp GetPhysicsTimestamp(float DeltaSeconds = 0.0f);
Generates a timestamp for the upcoming physics step (plus any pending time). Useful for synchronizing client and server events on a specific physics step On the server LocalFrame and ServerFrame are the same, on the…
GetNetworkPhysicsTickOffset
int32 GetNetworkPhysicsTickOffset() const;
Get the physics frame number offset between Local and Server, recommended is to use GetPhysicsTimestamp() which takes this offset into account on the client for the ServerFrame value
GetNetworkPhysicsTickOffsetAssigned
bool GetNetworkPhysicsTickOffsetAssigned() const;
True if the NetworkPhysicsTickOffset is setup, before this is setup the GetNetworkPhysicsTickOffset() and GetPhysicsTimestamp() functions will not return valid results
GetClientHandshakeId
uint32 GetClientHandshakeId() const;
Return the handshake cookie of the connection this player controller is associated.
SetClientHandshakeId
void SetClientHandshakeId(uint32 InClientHandshakeId);
Associate this player controller with a connection using it's handshake cookie.