| UObjectBase
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h |
Include |
#include "Kismet/GameplayStatics.h" |
class UGameplayStatics : public UBlueprintFunctionLibrary
Static class with useful gameplay utility functions that can be called from both Blueprint and C++
Name | Description | |
---|---|---|
|
UGameplayStatics ( |
Name | Description | ||
---|---|---|---|
|
void |
ActivateReverbEffect ( |
Activates a Reverb Effect without the need for an Audio Volume |
|
void |
AnnounceAccessibleString ( |
If accessibility is enabled, have the platform announce a string to the player. |
|
float |
ApplyDamage ( |
Hurts the specified actor with generic damage. |
|
float |
ApplyPointDamage ( |
Hurts the specified actor with the specified impact. |
|
bool |
ApplyRadialDamage ( |
Hurt locally authoritative actors within the radius. |
|
bool |
ApplyRadialDamageWithFalloff ( |
Hurt locally authoritative actors within the radius. |
|
bool |
AreAnyListenersWithinRange ( |
Determines if any audio listeners are within range of the specified location |
|
bool |
AreSubtitlesEnabled() |
Returns whether or not subtitles are currently enabled. |
|
void |
AsyncLoadGameFromSlot ( |
Schedule an async load of a specific slot. |
|
void |
AsyncSaveGameToSlot |
Schedule an async save to a specific slot. |
|
AActor * |
BeginDeferredActorSpawnFromClass ( |
Spawns an instance of an actor class, but does not automatically run its construction script. |
|
AActor * |
BeginSpawningActorFromBlueprint ( |
Spawns an instance of a blueprint, but does not automatically run its construction script. |
|
bool |
Blueprint_PredictProjectilePath_Advanced ( |
Predict the arc of a virtual projectile affected by gravity with collision checks along the arc. |
|
bool |
Blueprint_PredictProjectilePath_ByObjectType ( |
Predict the arc of a virtual projectile affected by gravity with collision checks along the arc. |
|
bool |
Blueprint_PredictProjectilePath_ByTraceChannel ( |
Predict the arc of a virtual projectile affected by gravity with collision checks along the arc. |
|
bool |
BlueprintSuggestProjectileVelocity ( |
Calculates an launch velocity for a projectile to hit a specified point. |
|
void |
BreakHitResult ( |
Extracts data from a HitResult. |
|
void |
CalculateViewProjectionMatricesFromMinimalView ( |
Calculate view-projection matrices from a specified MinimalViewInfo and optional custom projection matrix |
|
void |
CalculateViewProjectionMatricesFromViewTarget ( |
Calculate view-projection matrices from a specified view target |
|
void |
CancelAsyncLoading() |
Cancels all currently queued streaming packages |
|
void |
ClearSoundMixClassOverride ( |
Clears any existing override of the Sound Class Adjuster in the given Sound Mix |
|
void |
ClearSoundMixModifiers ( |
Clear all sound mix modifiers from the audio system |
|
APlayerContr... |
CreatePlayer ( |
Create a new local player for this game, for cases like local multiplayer. |
|
APlayerContr... |
CreatePlayerFromPlatformUser ( |
Create a new local player for this game, for cases like local multiplayer. |
|
USaveGame &#... |
CreateSaveGameObject ( |
Create a new, empty SaveGame object to set data on and then pass to SaveGameToSlot. |
|
UAudioCompon... |
CreateSound2D ( |
This function allows users to create Audio Components in advance of playback with settings specifically for non-spatialized, non-distance-attenuated sounds. |
|
void |
DeactivateReverbEffect |
Deactivates a Reverb Effect that was applied outside of an Audio Volume |
|
bool |
DeleteGameInSlot ( |
Delete a save game in a particular slot. |
|
bool |
DeprojectSceneCaptureToWorld ( |
Transforms the given 2D UV coordinate into a 3D world-space point and direction. |
|
bool |
DeprojectScreenToWorld ( |
Transforms the given 2D screen space coordinate into a 3D world-space point and direction. |
|
bool |
DoesSaveGameExist ( |
See if a save game exists with the specified name. |
|
void |
EnableLiveStreaming ( |
Toggle live DVR streaming. |
|
bool |
FindCollisionUV ( |
Try and find the UV for a collision impact. |
|
AActor * |
FindNearestActor |
Returns an Actor nearest to Origin from ActorsToCheck array. |
|
AActor * |
FinishSpawningActor ( |
'Finish' spawning an actor. This will run the construction script. |
|
void |
FlushLevelStreaming ( |
Flushes level streaming in blocking fashion and returns when all sub-levels are loaded / visible / hidden |
|
void |
GetAccurateRealTime ( |
Returns time in seconds since the application was started. |
|
GetActiveSpatialPluginName ( |
Get currently active Audio Spatialization Plugin name |
|
|
FVector |
GetActorArrayAverageLocation |
Find the average location (centroid) of an array of Actors |
|
void |
GetActorArrayBounds |
Bind the bounds of an array of Actors |
|
AActor * |
GetActorOfClass ( |
Find the first Actor in the world of the specified class. |
|
void |
GetAllActorsOfClass ( |
Find all Actors in the world of the specified class. |
|
void |
GetAllActorsOfClassWithTag |
Find all Actors in the world of the specified class with the specified tag. |
|
void |
GetAllActorsWithInterface ( |
Find all Actors in the world with the specified interface. |
|
void |
GetAllActorsWithTag |
Find all Actors in the world with the specified tag. |
|
double |
GetAudioTimeSeconds ( |
Returns time in seconds since world was brought up for play, IS stopped when game pauses, NOT dilated/clamped. |
|
GetAvailableSpatialPluginNames ( |
Get list of available Audio Spatialization Plugin names |
|
|
bool |
GetClosestListenerLocation ( |
Finds and returns the position of the closest listener to the specified location |
|
GetCurrentLevelName ( |
Get the name of the currently-open level. |
|
|
UReverbEffec... |
GetCurrentReverbEffect ( |
Returns the highest priority reverb settings currently active from any source (Audio Volumes or manual settings). |
|
bool |
GetEnableWorldRendering ( |
Returns the world rendering state |
|
UGameInstanc... |
GetGameInstance ( |
Returns the game instance object |
|
AGameModeBas... |
GetGameMode ( |
Returns the current GameModeBase or Null if it can't be retrieved, such as on the client |
|
AGameStateBa... |
GetGameState ( |
Returns the current GameStateBase or Null if it can't be retrieved |
|
float |
GetGlobalTimeDilation ( |
Gets the current global time dilation. |
|
int32 |
GetIntOption |
Find an option in the options string and return it as an integer. |
|
void |
GetKeyValue |
Break up a key=value pair into its key and value. |
|
int32 |
GetMaxAudioChannelCount ( |
Retrieves the max voice count currently used by the audio engine. |
|
int32 |
GetNumLocalPlayerControllers ( |
Returns the number of fully initialized local players, this will be 0 on dedicated servers. |
|
int32 |
GetNumPlayerControllers ( |
Returns the total number of available player controllers, including remote players when called on a server. |
|
int32 |
GetNumPlayerStates ( |
Returns the number of active player states, there is one player state for every connected player even if they are a remote client. |
|
UClass * |
GetObjectClass ( |
Returns the class of a passed in Object, will always be valid if Object is not NULL |
|
GetPlatformName() |
Returns the string name of the current platform, to perform different behavior based on platform. |
|
|
APlayerCamer... |
GetPlayerCameraManager ( |
Returns the camera manager for the Player Controller at the specified player index. |
|
ACharacter &... |
GetPlayerCharacter ( |
Returns the pawn for the player controller at the specified player index, will return null if the pawn is not a character. |
|
APlayerContr... |
GetPlayerController ( |
Returns the player controller found while iterating through the local and available remote player controllers. |
|
APlayerContr... |
GetPlayerControllerFromID ( |
Returns the player controller with the specified physical controller ID. |
|
APlayerContr... |
GetPlayerControllerFromPlatformUser ( |
Returns the player controller with the specified physical controller ID. |
|
int32 |
GetPlayerControllerID ( |
Gets what physical controller ID a player is using. This only works for local player controllers. |
|
APawn * |
GetPlayerPawn ( |
Returns the pawn for the player controller at the specified player index. |
|
APlayerState... |
GetPlayerState ( |
Returns the player state at the given index in the game state's PlayerArray. |
|
APlayerState... |
GetPlayerStateFromUniqueNetId ( |
Returns the player state that matches the passed in online id, or null for an invalid one. |
|
double |
GetRealTimeSeconds ( |
Returns time in seconds since world was brought up for play, does NOT stop when game pauses, NOT dilated/clamped |
|
ULevelStream... |
GetStreamingLevel |
Returns level streaming object with specified level package name |
|
EPhysicalSur... |
GetSurfaceType ( |
Returns the EPhysicalSurface type of the given Hit. |
|
double |
GetTimeSeconds ( |
Returns time in seconds since world was brought up for play, adjusted by time dilation and IS stopped when game pauses |
|
double |
GetUnpausedTimeSeconds ( |
Returns time in seconds since world was brought up for play, adjusted by time dilation and IS NOT stopped when game pauses |
|
EMouseCaptur... |
GetViewportMouseCaptureMode ( |
Returns the current viewport mouse capture mode |
|
void |
GetViewProjectionMatrix ( |
Returns the View Matrix, Projection Matrix and the View x Projection Matrix for a given view |
|
double |
GetWorldDeltaSeconds ( |
Returns the frame delta time in seconds, adjusted by time dilation. |
|
FIntVector |
GetWorldOriginLocation ( |
Returns world origin current location. |
|
bool |
GrabOption |
|
|
int32 |
GrassOverlappingSphereCount ( |
Counts how many grass foliage instances overlap a given sphere. |
|
bool |
HasLaunchOption ( |
Checks the commandline to see if the desired option was specified on the commandline (e.g. -demobuild) |
|
bool |
HasOption |
Returns whether a key exists in an options string. |
|
bool |
IsGamePaused ( |
Returns the game's paused state |
|
bool |
IsSplitscreenForceDisabled ( |
Returns the split screen state |
|
bool |
LoadDataFromSlot |
Load contents from a slot/file into a buffer of save data. |
|
USaveGame &#... |
LoadGameFromMemory ( |
Tries to load a SaveGame object from a given array of bytes. |
|
USaveGame &#... |
LoadGameFromSlot ( |
Load the contents from a given slot. |
|
void |
LoadStreamLevel ( |
Stream the level (by Name); Calling again before it finishes has no effect |
|
void |
LoadStreamLevelBySoftObjectPtr ( |
Stream the level (by Object Reference); Calling again before it finishes has no effect |
|
MakeHitResult ( |
Create a HitResult struct |
|
|
bool |
ObjectIsA ( |
Returns whether or not the object passed in is of (or inherits from) the class type. |
|
void |
OpenLevel |
Travel to another level |
|
void |
OpenLevelBySoftObjectPtr ( |
Travel to another level |
|
ParseOption |
Find an option in the options string and return it. |
|
|
void |
PlayDialogue2D ( |
Plays a dialogue directly with no attenuation, perfect for UI. |
|
void |
PlayDialogueAtLocation ( |
|
|
void |
PlayDialogueAtLocation ( |
Plays a dialogue at the given location. |
|
void |
PlaySound2D ( |
Plays a sound directly with no attenuation, perfect for UI sounds. |
|
void |
PlaySoundAtLocation ( |
Plays a sound at the given location. |
|
void |
PlaySoundAtLocation ( |
|
|
void |
PlayWorldCameraShake ( |
Plays an in-world camera shake that affects all nearby local players, with distance-based attenuation. |
|
void |
PopSoundMixModifier |
Pop a sound mix modifier from the audio system |
|
bool |
PredictProjectilePath ( |
Predict the arc of a virtual projectile affected by gravity with collision checks along the arc. |
|
void |
PrimeAllSoundsInSoundClass ( |
Primes the sound waves in the given USoundClass, caching the first chunk of streamed audio. |
|
void |
PrimeSound ( |
Primes the sound, caching the first chunk of streamed audio. |
|
bool |
ProjectWorldToScreen ( |
Transforms the given 3D world-space point into a its 2D screen space coordinate. |
|
void |
PushSoundMixModifier |
Push a sound mix modifier onto the audio system |
|
FVector |
RebaseLocalOriginOntoZero ( |
Returns origin based position for local world location. |
|
FVector |
RebaseZeroOriginOntoLocal ( |
Returns local location for origin based position. |
|
void |
RemovePlayer ( |
Removes a local player from this game. |
|
bool |
SaveDataToSlot |
Save the contents of the buffer to a platform-specific save slot/file |
|
bool |
SaveGameToMemory |
Serialize our USaveGame object into a given array of bytes |
|
bool |
SaveGameToSlot |
Save the contents of the SaveGameObject to a platform-specific save slot/file. |
|
bool |
SetActiveSpatialPluginByName |
Get list of available Audio Spatialization Plugins |
|
void |
SetBaseSoundMix |
Audio Functions ---------------------- |
|
void |
SetEnableWorldRendering ( |
Enabled rendering of the world |
|
void |
SetForceDisableSplitscreen ( |
Enables split screen |
|
bool |
SetGamePaused ( |
Sets the game's paused state |
|
void |
SetGlobalListenerFocusParameters ( |
Sets the global listener focus parameters, which will scale focus behavior of sounds based on their focus azimuth settings in their attenuation settings. |
|
void |
SetGlobalPitchModulation ( |
Sets a global pitch modulation scalar that will apply to all non-UI sounds |
|
void |
SetGlobalTimeDilation ( |
Sets the global time dilation. |
|
void |
SetMaxAudioChannelsScaled ( |
Sets the max number of voices (also known as "channels") dynamically by percentage. |
|
void |
SetPlayerControllerID ( |
Sets what physical controller ID a player should be using. |
|
void |
SetPlayerPlatformUserId ( |
Sets what platform user id a player should be using. This only works for local player controllers. |
|
void |
SetSoundClassDistanceScale ( |
Linearly interpolates the attenuation distance scale value from it's current attenuation distance override value (1.0f it not overridden) to its new attenuation distance override, over the given amount of time |
|
void |
SetSoundMixClassOverride ( |
Overrides the sound class adjuster in the given sound mix. |
|
void |
SetSubtitlesEnabled ( |
Will set subtitles to be enabled or disabled. |
|
void |
SetViewportMouseCaptureMode ( |
Sets the current viewport mouse capture mode |
|
void |
SetWorldOriginLocation ( |
Requests a new location for a world origin. |
|
UDecalCompon... |
SpawnDecalAtLocation ( |
Spawns a decal at the given location and rotation, fire and forget. Does not replicate. |
|
UDecalCompon... |
SpawnDecalAttached ( |
Spawns a decal attached to and following the specified component. Does not replicate. |
|
UAudioCompon... |
SpawnDialogue2D ( |
Spawns a DialogueWave, a special type of Asset that requires Context data in order to resolve a specific SoundBase, which is then passed on to the new Audio Component. |
|
UAudioCompon... |
SpawnDialogueAtLocation ( |
Spawns a DialogueWave, a special type of Asset that requires Context data in order to resolve a specific SoundBase, which is then passed on to the new Audio Component. |
|
UAudioCompon... |
SpawnDialogueAttached ( |
Spawns a DialogueWave, a special type of Asset that requires Context data in order to resolve a specific SoundBase, which is then passed on to the new Audio Component. |
|
UAudioCompon... |
SpawnDialogueAttached ( |
|
|
UParticleSys... |
SpawnEmitterAtLocation ( |
Plays the specified effect at the given location and rotation, fire and forget. |
|
UParticleSys... |
SpawnEmitterAtLocation ( |
Backwards compatible version of SpawnEmitterAttached for C++ without Scale. |
|
UParticleSys... |
SpawnEmitterAtLocation ( |
Plays the specified effect at the given location and rotation, fire and forget. |
|
UParticleSys... |
SpawnEmitterAttached ( |
Plays the specified effect attached to and following the specified component. |
|
UParticleSys... |
SpawnEmitterAttached ( |
Backwards compatible version of SpawnEmitterAttached for C++ without Scale. |
|
UForceFeedba... |
SpawnForceFeedbackAtLocation ( |
Plays a force feedback effect at the given location. |
|
UForceFeedba... |
SpawnForceFeedbackAttached ( |
Plays a force feedback effect attached to and following the specified component. |
|
UObject *... |
SpawnObject ( |
Create Object |
|
UAudioCompon... |
SpawnSound2D ( |
This function allows users to create Audio Components with settings specifically for non-spatialized, non-distance-attenuated sounds. |
|
UAudioCompon... |
SpawnSoundAtLocation ( |
Spawns a sound at the given location. |
|
UAudioCompon... |
SpawnSoundAttached ( |
This function allows users to create and play Audio Components attached to a specific Scene Component. |
|
UAudioCompon... |
SpawnSoundAttached ( |
|
|
FMemoryReade... |
StripSaveGameHeader ( |
Takes the provided buffer and consumes it, parsing past the internal header data, returning a MemoryReader that has: 1) been set up with all the related header information, and 2) offset to where tagged USaveGame object serialization begins. NOTE: that the returned object has a reference to the supplied data - scope them accordingly. |
|
bool |
SuggestProjectileVelocity ( |
Native version, has more options than the Blueprint version. |
|
bool |
SuggestProjectileVelocity_CustomArc ( |
Returns the launch velocity needed for a projectile at rest at StartPos to land on EndPos. |
|
void |
UnloadStreamLevel ( |
Unload a streamed in level (by Name) |
|
void |
UnloadStreamLevelBySoftObjectPtr ( |
Unload a streamed in level (by Object Reference) |
|
void |
UnRetainAllSoundsInSoundClass ( |
Iterate through all sound waves and releases handles to retained chunks. |
Name | Description | ||
---|---|---|---|
|
void |
GetAccurateRealTime ( |
This method has been deprecated and will be removed. Use the double version instead. |