UGameplayStatics

Windows
MacOS
Linux

Inheritance Hierarchy

Syntax

class UGameplayStatics : public UBlueprintFunctionLibrary

Constructors

Name Description

Public function

UGameplayStatics

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Static

void

 

ActivateReverbEffect

(
    const UObject* WorldContextObj...,
    UReverbEffect* ReverbEffect,
    FName TagName,
    float Priority,
    float Volume,
    float FadeTime
)

Activates a Reverb Effect without the need for a volume

Public function Static

float

 

ApplyDamage

(
    AActor* DamagedActor,
    float BaseDamage,
    AController* EventInstigator,
    AActor* DamageCauser,
    TSubclassOf< class UDamageType > Da...
)

Hurts the specified actor with generic damage.

Public function Static

float

 

ApplyPointDamage

(
    AActor* DamagedActor,
    float BaseDamage,
    const FVector& HitFromDirection,
    const FHitResult& HitInfo,
    AController* EventInstigator,
    AActor* DamageCauser,
    TSubclassOf< class UDamageType > Da...
)

Hurts the specified actor with the specified impact.

Public function Static

bool

 

ApplyRadialDamage

(
    const UObject* WorldContextObj...,
    float BaseDamage,
    const FVector& Origin,
    float DamageRadius,
    TSubclassOf< class UDamageType > Da...,
    const TArray< AActor* >& Igno...,
    AActor* DamageCauser,
    AController* InstigatedByContr...,
    bool bDoFullDamage,
    ECollisionChannel DamagePreventionC...
)

Hurt locally authoritative actors within the radius.

Public function Static

bool

 

ApplyRadialDamageWithFalloff

(
    const UObject* WorldContextObj...,
    float BaseDamage,
    float MinimumDamage,
    const FVector& Origin,
    float DamageInnerRadius,
    float DamageOuterRadius,
    float DamageFalloff,
    TSubclassOf< class UDamageType > Da...,
    const TArray< AActor* >& Igno...,
    AActor* DamageCauser,
    AController* InstigatedByContr...,
    ECollisionChannel DamagePreventionC...
)

Hurt locally authoritative actors within the radius.

Public function Static

bool

 

AreAnyListenersWithinRange

(
    const UObject* WorldContextObj...,
    FVector Location,
    float MaximumRange
)

Determines if any audio listeners are within range of the specified location

Public function Static

bool

 

AreSubtitlesEnabled()

Returns whether or not subtitles are currently enabled.

Public function Static

AActor *

 

BeginDeferredActorSpawnFromClass

(
    const UObject* WorldContextObj...,
    TSubclassOf< AActor > ActorClass,
    const FTransform& SpawnTransform,
    ESpawnActorCollisionHandlingMethod ...,
    AActor* Owner
)

Spawns an instance of an actor class, but does not automatically run its construction script.

Public function Static

AActor *

 

BeginSpawningActorFromBlueprint

(
    const UObject* WorldContextObj...,
    const UBlueprint* Blueprint,
    const FTransform& SpawnTransform,
    bool bNoCollisionFail
)

Spawns an instance of a blueprint, but does not automatically run its construction script.

Public function Static

bool

 

Blueprint_PredictProjectilePath_Advanced

(
    const UObject* WorldContextObj...,
    const FPredictProjectilePathParams ...,
    FPredictProjectilePathResult& Pred...
)

Predict the arc of a virtual projectile affected by gravity with collision checks along the arc.

Public function Static

bool

 

Blueprint_PredictProjectilePath_ByObjectType

(
    const UObject* WorldContextObj...,
    FHitResult& OutHit,
    TArray< FVector >& OutPathPosition...,
    FVector& OutLastTraceDestination,
    FVector StartPos,
    FVector LaunchVelocity,
    bool bTracePath,
    float ProjectileRadius,
    const TArray< TEnumAsByte< EObjectT...,
    bool bTraceComplex,
    const TArray< AActor* >& Acto...,
    EDrawDebugTrace::Type DrawDebugType,
    float DrawDebugTime,
    float SimFrequency,
    float MaxSimTime,
    float OverrideGravityZ
)

Predict the arc of a virtual projectile affected by gravity with collision checks along the arc.

Public function Static

bool

 

Blueprint_PredictProjectilePath_ByTraceChannel

(
    const UObject* WorldContextObj...,
    FHitResult& OutHit,
    TArray< FVector >& OutPathPosition...,
    FVector& OutLastTraceDestination,
    FVector StartPos,
    FVector LaunchVelocity,
    bool bTracePath,
    float ProjectileRadius,
    TEnumAsByte< ECollisionChannel > Tr...,
    bool bTraceComplex,
    const TArray< AActor* >& Acto...,
    EDrawDebugTrace::Type DrawDebugType,
    float DrawDebugTime,
    float SimFrequency,
    float MaxSimTime,
    float OverrideGravityZ
)

Predict the arc of a virtual projectile affected by gravity with collision checks along the arc.

Public function Static

bool

 

BlueprintSuggestProjectileVelocity

(
    const UObject* WorldContextObj...,
    FVector& TossVelocity,
    FVector StartLocation,
    FVector EndLocation,
    float LaunchSpeed,
    float OverrideGravityZ,
    ESuggestProjVelocityTraceOption::Ty...,
    float CollisionRadius,
    bool bFavorHighArc,
    bool bDrawDebug
)

Calculates an launch velocity for a projectile to hit a specified point.

Public function Static

void

 

BreakHitResult

(
    const FHitResult& Hit,
    bool& bBlockingHit,
    bool& bInitialOverlap,
    float& Time,
    float& Distance,
    FVector& Location,
    FVector& ImpactPoint,
    FVector& Normal,
    FVector& ImpactNormal,
    UPhysicalMaterial*& PhysMat,
    AActor*& HitActor,
    UPrimitiveComponent*& HitCompo...,
    FName& HitBoneName,
    int32& HitItem,
    int32& FaceIndex,
    FVector& TraceStart,
    FVector& TraceEnd
)

Extracts data from a HitResult.

Public function Static

void

 

CancelAsyncLoading()

Cancels all currently queued streaming packages

Public function Static

void

 

ClearSoundMixClassOverride

(
    const UObject* WorldContextObj...,
    USoundMix* InSoundMixModifier,
    USoundClass* InSoundClass,
    float FadeOutTime
)

Clears the override of the sound class adjuster in the given sound mix.

Public function Static

void

 

ClearSoundMixModifiers

(
    const UObject* WorldContextObj...
)

Clear all sound mix modifiers from the audio system

Public function Static

APlayerContr...

 

CreatePlayer

(
    const UObject* WorldContextObj...,
    int32 ControllerId,
    bool bSpawnPlayerController
)

Create a new player for this game.

Public function Static

USaveGame &#...

 

CreateSaveGameObject

(
    TSubclassOf< USaveGame > SaveGameCl...
)

Create a new, empty SaveGame object to set data on and then pass to SaveGameToSlot.

Public function Static

USaveGame &#...

 

CreateSaveGameObjectFromBlueprint

(
    UBlueprint* SaveGameBlueprint
)

Create a new, empty SaveGame object to set data on and then pass to SaveGameToSlot.

Public function Static

UAudioCompon...

 

CreateSound2D

(
    const UObject* WorldContextObj...,
    USoundBase* Sound,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundConcurrency* Concurrency...,
    bool bPersistAcrossLevelTransition,
    bool bAutoDestroy
)

Creates a sound with no attenuation, perfect for UI sounds.

Public function Static

void

 

DeactivateReverbEffect

(
    const UObject* WorldContextObj...,
    FName TagName
)

Deactivates a Reverb Effect not applied by a volume

Public function Static

bool

 

DeleteGameInSlot

(
    const FString& SlotName,
    const int32 UserIndex
)

Delete a save game in a particular slot.

Public function Static

bool

 

DeprojectScreenToWorld

(
    APlayerController const* Playe...,
    const FVector2D& ScreenPosition,
    FVector& WorldPosition,
    FVector& WorldDirection
)

Transforms the given 2D screen space coordinate into a 3D world-space point and direction.

Public function Static

bool

 

DoesSaveGameExist

(
    const FString& SlotName,
    const int32 UserIndex
)

See if a save game exists with the specified name.

Public function Static

void

 

EnableLiveStreaming

(
    bool Enable
)

Toggle live DVR streaming.

Public function Static

bool

 

FindCollisionUV

(
    const FHitResult& Hit,
    int32 UVChannel,
    FVector2D& UV
)

Try and find the UV for a collision impact.

Public function Static

AActor *

 

FinishSpawningActor

(
    AActor* Actor,
    const FTransform& SpawnTransform
)

'Finish' spawning an actor. This will run the construction script.

Public function Static

void

 

FlushLevelStreaming

(
    const UObject* WorldContextObj...
)

Flushes level streaming in blocking fashion and returns when all sub-levels are loaded / visible / hidden

Public function Static

void

 

GetAccurateRealTime

(
    const UObject* WorldContextObj...,
    int32& Seconds,
    float& PartialSeconds
)

Public function Static

FVector

 

GetActorArrayAverageLocation

(
    const TArray< AActor* >& Acto...
)

Find the average location (centroid) of an array of Actors

Public function Static

void

 

GetActorArrayBounds

(
    const TArray< AActor* >& Acto...,
    bool bOnlyCollidingComponents,
    FVector& Center,
    FVector& BoxExtent
)

Bind the bounds of an array of Actors

Public function Static

void

 

GetAllActorsOfClass

(
    const UObject* WorldContextObj...,
    TSubclassOf< AActor > ActorClass,
    TArray< AActor* >& OutActors
)

Find all Actors in the world of the specified class.

Public function Static

void

 

GetAllActorsWithInterface

(
    const UObject* WorldContextObj...,
    TSubclassOf< UInterface > Interface,
    TArray< AActor* >& OutActors
)

Find all Actors in the world with the specified interface.

Public function Static

void

 

GetAllActorsWithTag

(
    const UObject* WorldContextObj...,
    FName Tag,
    TArray< AActor* >& OutActors
)

Find all Actors in the world with the specified tag.

Public function Static

float

 

GetAudioTimeSeconds

(
    const UObject* WorldContextObj...
)

Returns time in seconds since world was brought up for play, IS stopped when game pauses, NOT dilated/clamped.

Public function Static

FString

 

GetCurrentLevelName

(
    const UObject* WorldContextObj...,
    bool bRemovePrefixString
)

Get the name of the currently-open level.

Public function Static

UReverbEffec...

 

GetCurrentReverbEffect

(
    const UObject* WorldContextObj...
)

Returns the highest priority reverb settings currently active from any source (volumes or manual setting).

Public function Static

bool

 

GetEnableWorldRendering

(
    const UObject* WorldContextObj...
)

Returns the world rendering state

Public function Static

UGameInstanc...

 

GetGameInstance

(
    const UObject* WorldContextObj...
)

Returns the game instance object

Public function Static

AGameModeBas...

 

GetGameMode

(
    const UObject* WorldContextObj...
)

Returns the current GameModeBase or Null if it can't be retrieved, such as on the client

Public function Static

AGameStateBa...

 

GetGameState

(
    const UObject* WorldContextObj...
)

Returns the current GameStateBase or Null if it can't be retrieved

Public function Static

float

 

GetGlobalTimeDilation

(
    const UObject* WorldContextObj...
)

Gets the current global time dilation.

Public function Static

int32

 

GetIntOption

(
    const FString& Options,
    const FString& Key,
    int32 DefaultValue
)

Find an option in the options string and return it as an integer.

Public function Static

void

 

GetKeyValue

(
    const FString& Pair,
    FString& Key,
    FString& Value
)

Break up a key=value pair into its key and value.

Public function Static

int32

 

GetMaxAudioChannelCount

(
    const UObject* WorldContextObj...
)

Retrieves the max voice count currently used by the audio engine.

Public function Static

UClass *

 

GetObjectClass

(
    const UObject* Object
)

Returns the class of a passed in Object, will always be valid if Object is not NULL

Public function Static

FString

 

GetPlatformName()

Returns the string name of the current platform, to perform different behavior based on platform.

Public function Static

APlayerCamer...

 

GetPlayerCameraManager

(
    const UObject* WorldContextObj...,
    int32 PlayerIndex
)

Returns the player's camera manager for the specified player index

Public function Static

ACharacter &...

 

GetPlayerCharacter

(
    const UObject* WorldContextObj...,
    int32 PlayerIndex
)

Returns the player character (NULL if the player pawn doesn't exist OR is not a character) at the specified player index

Public function Static

APlayerContr...

 

GetPlayerController

(
    const UObject* WorldContextObj...,
    int32 PlayerIndex
)

Returns the player controller at the specified player index

Public function Static

int32

 

GetPlayerControllerID

(
    APlayerController* Player
)

Gets what controller ID a Player is using

Public function Static

APawn *

 

GetPlayerPawn

(
    const UObject* WorldContextObj...,
    int32 PlayerIndex
)

Returns the player pawn at the specified player index

Public function Static

float

 

GetRealTimeSeconds

(
    const UObject* WorldContextObj...
)

Returns time in seconds since world was brought up for play, does NOT stop when game pauses, NOT dilated/clamped

Public function Static

ULevelStream...

 

GetStreamingLevel

(
    const UObject* WorldContextObj...,
    FName PackageName
)

Returns level streaming object with specified level package name

Public function Static

EPhysicalSur...

 

GetSurfaceType

(
    const FHitResult& Hit
)

Returns the EPhysicalSurface type of the given Hit.

Public function Static

float

 

GetTimeSeconds

(
    const UObject* WorldContextObj...
)

Returns time in seconds since world was brought up for play, adjusted by time dilation and IS stopped when game pauses

Public function Static

float

 

GetUnpausedTimeSeconds

(
    const UObject* WorldContextObj...
)

Returns time in seconds since world was brought up for play, adjusted by time dilation and IS NOT stopped when game pauses

Public function Static

float

 

GetWorldDeltaSeconds

(
    const UObject* WorldContextObj...
)

Returns the frame delta time in seconds, adjusted by time dilation.

Public function Static

FIntVector

 

GetWorldOriginLocation

(
    const UObject* WorldContextObj...
)

Returns world origin current location.

Public function Static

bool

 

GrabOption

(
    FString& Options,
    FString& ResultString
)

Public function Static

int32

 

GrassOverlappingSphereCount

(
    const UObject* WorldContextObj...,
    const UStaticMesh* StaticMesh,
    FVector CenterPosition,
    float Radius
)

Counts how many grass foliage instances overlap a given sphere.

Public function Static

bool

 

HasLaunchOption

(
    const FString& OptionToCheck
)

Checks the commandline to see if the desired option was specified on the commandline (e.g. -demobuild)

Public function Static

bool

 

HasOption

(
    FString Options,
    const FString& InKey
)

Returns whether a key exists in an options string.

Public function Static

bool

 

IsGamePaused

(
    const UObject* WorldContextObj...
)

Returns the game's paused state

Public function Static

USaveGame &#...

 

LoadGameFromMemory

(
    const TArray< uint8 >& InSaveData
)

Load the contents from a given array of bytes.

Public function Static

USaveGame &#...

 

LoadGameFromSlot

(
    const FString& SlotName,
    const int32 UserIndex
)

Load the contents from a given slot.

Public function Static

void

 

LoadStreamLevel

(
    const UObject* WorldContextObj...,
    FName LevelName,
    bool bMakeVisibleAfterLoad,
    bool bShouldBlockOnLoad,
    FLatentActionInfo LatentInfo
)

Stream the level with the LevelName ; Calling again before it finishes has no effect

Public function Static

FHitResult

 

MakeHitResult

(
    bool bBlockingHit,
    bool bInitialOverlap,
    float Time,
    float Distance,
    FVector Location,
    FVector ImpactPoint,
    FVector Normal,
    FVector ImpactNormal,
    UPhysicalMaterial* PhysMat,
    AActor* HitActor,
    UPrimitiveComponent* HitCompon...,
    FName HitBoneName,
    int32 HitItem,
    int32 FaceIndex,
    FVector TraceStart,
    FVector TraceEnd
)

Create a HitResult struct

Public function Static

void

 

OpenLevel

(
    const UObject* WorldContextObj...,
    FName LevelName,
    bool bAbsolute,
    FString Options
)

Travel to another level

Public function Static

FString

 

ParseOption

(
    FString Options,
    const FString& Key
)

Find an option in the options string and return it.

Public function Static

void

 

PlayDialogue2D

(
    const UObject* WorldContextObj...,
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime
)

Plays a dialogue directly with no attenuation, perfect for UI.

Public function Static

void

 

PlayDialogueAtLocation

(
    const UObject* WorldContextObj...,
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    FVector Location,
    FRotator Rotation,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...
)

Plays a dialogue at the given location.

Public function Static

void

 

PlayDialogueAtLocation

(
    const UObject* WorldContextObj...,
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    FVector Location,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...
)

Public function Static

void

 

PlaySound2D

(
    const UObject* WorldContextObj...,
    USoundBase* Sound,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundConcurrency* Concurrency...,
    AActor* OwningActor
)

Plays a sound directly with no attenuation, perfect for UI sounds.

Public function Static

void

 

PlaySoundAtLocation

(
    const UObject* WorldContextObj...,
    USoundBase* Sound,
    FVector Location,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    USoundConcurrency* Concurrency...
)

Public function Static

void

 

PlaySoundAtLocation

(
    const UObject* WorldContextObj...,
    USoundBase* Sound,
    FVector Location,
    FRotator Rotation,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    USoundConcurrency* Concurrency...,
    AActor* OwningActor
)

Plays a sound at the given location.

Public function Static

void

 

PlayWorldCameraShake

(
    const UObject* WorldContextObj...,
    TSubclassOf< class UCameraShake > S...,
    FVector Epicenter,
    float InnerRadius,
    float OuterRadius,
    float Falloff,
    bool bOrientShakeTowardsEpicenter
)

Plays an in-world camera shake that affects all nearby local players, with distance-based attenuation.

Public function Static

void

 

PopSoundMixModifier

(
    const UObject* WorldContextObj...,
    USoundMix* InSoundMixModifier
)

Pop a sound mix modifier from the audio system

Public function Static

bool

 

PredictProjectilePath

(
    const UObject* WorldContextObj...,
    const FPredictProjectilePathParams ...,
    FPredictProjectilePathResult& Pred...
)

Predict the arc of a virtual projectile affected by gravity with collision checks along the arc.

Public function Static

bool

 

ProjectWorldToScreen

(
    APlayerController const* Playe...,
    const FVector& WorldPosition,
    FVector2D& ScreenPosition,
    bool bPlayerViewportRelative
)

Transforms the given 3D world-space point into a its 2D screen space coordinate.

Public function Static

void

 

PushSoundMixModifier

(
    const UObject* WorldContextObj...,
    USoundMix* InSoundMixModifier
)

Push a sound mix modifier onto the audio system

Public function Static

FVector

 

RebaseLocalOriginOntoZero

(
    UObject* WorldContextObject,
    FVector WorldLocation
)

Returns origin based position for local world location.

Public function Static

FVector

 

RebaseZeroOriginOntoLocal

(
    UObject* WorldContextObject,
    FVector WorldLocation
)

Returns local location for origin based position.

Public function Static

void

 

RemovePlayer

(
    APlayerController* Player,
    bool bDestroyPawn
)

Removes a player from this game.

Public function Static

bool

 

SaveDataToSlot

(
    const TArray< uint8 >& InSaveData,
    const FString& SlotName,
    const int32 UserIndex
)

Save the contents of the buffer to a slot/file

Public function Static

bool

 

SaveGameToMemory

(
    USaveGame* SaveGameObject,
    TArray< uint8 >& OutSaveData
)

Serialize our USaveGame object into a given array of bytes

Public function Static

bool

 

SaveGameToSlot

(
    USaveGame* SaveGameObject,
    const FString& SlotName,
    const int32 UserIndex
)

Save the contents of the SaveGameObject to a slot.

Public function Static

void

 

SetBaseSoundMix

(
    const UObject* WorldContextObj...,
    USoundMix* InSoundMix
)

Audio Functions ----------------------

Public function Static

void

 

SetEnableWorldRendering

(
    const UObject* WorldContextObj...,
    bool bEnable
)

Enabled rendering of the world

Public function Static

bool

 

SetGamePaused

(
    const UObject* WorldContextObj...,
    bool bPaused
)

Sets the game's paused state

Public function Static

void

 

SetGlobalListenerFocusParameters

(
    const UObject* WorldContextObj...,
    float FocusAzimuthScale,
    float NonFocusAzimuthScale,
    float FocusDistanceScale,
    float NonFocusDistanceScale,
    float FocusVolumeScale,
    float NonFocusVolumeScale,
    float FocusPriorityScale,
    float NonFocusPriorityScale
)

Sets the global listener focus parameters which will scale focus behavior of sounds based on their focus azimuth settings in their attenuation settings.

Public function Static

void

 

SetGlobalPitchModulation

(
    const UObject* WorldContextObj...,
    float PitchModulation,
    float TimeSec
)

Sets a global pitch modulation scalar that will apply to all non-UI sounds

Public function Static

void

 

SetGlobalTimeDilation

(
    const UObject* WorldContextObj...,
    float TimeDilation
)

Sets the global time dilation.

Public function Static

void

 

SetMaxAudioChannelsScaled

(
    const UObject* WorldContextObj...,
    float MaxChannelCountScale
)

Sets the max number of voices (also known as "channels") dynamically by percentage.

Public function Static

void

 

SetPlayerControllerID

(
    APlayerController* Player,
    int32 ControllerId
)

Sets what controller ID a Player should be using

Public function Static

void

 

SetSoundMixClassOverride

(
    const UObject* WorldContextObj...,
    USoundMix* InSoundMixModifier,
    USoundClass* InSoundClass,
    float Volume,
    float Pitch,
    float FadeInTime,
    bool bApplyToChildren
)

Overrides the sound class adjuster in the given sound mix.

Public function Static

void

 

SetSubtitlesEnabled

(
    bool bEnabled
)

Will set subtitles to be enabled or disabled.

Public function Static

void

 

SetWorldOriginLocation

(
    const UObject* WorldContextObj...,
    FIntVector NewLocation
)

Requests a new location for a world origin.

Public function Static

UDecalCompon...

 

SpawnDecalAtLocation

(
    const UObject* WorldContextObj...,
    UMaterialInterface* DecalMater...,
    FVector DecalSize,
    FVector Location,
    FRotator Rotation,
    float LifeSpan
)

Spawns a decal at the given location and rotation, fire and forget. Does not replicate.

Public function Static

UDecalCompon...

 

SpawnDecalAttached

(
    UMaterialInterface* DecalMater...,
    FVector DecalSize,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    FRotator Rotation,
    EAttachLocation::Type LocationType,
    float LifeSpan
)

Spawns a decal attached to and following the specified component. Does not replicate.

Public function Static

UAudioCompon...

 

SpawnDialogue2D

(
    const UObject* WorldContextObj...,
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    bool bAutoDestroy
)

Spawns a dialogue with no attenuation, perfect for UI.

  • Not Replicated.

Public function Static

UAudioCompon...

 

SpawnDialogueAtLocation

(
    const UObject* WorldContextObj...,
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    FVector Location,
    FRotator Rotation,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    bool bAutoDestroy
)

Plays a dialogue at the given location.

Public function Static

UAudioCompon...

 

SpawnDialogueAttached

(
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    FRotator Rotation,
    EAttachLocation::Type LocationType,
    bool bStopWhenAttachedToDestroyed,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    bool bAutoDestroy
)

Spawns a dialogue attached to and following the specified component.

Public function Static

UAudioCompon...

 

SpawnDialogueAttached

(
    UDialogueWave* Dialogue,
    const FDialogueContext& Context,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    EAttachLocation::Type LocationType,
    bool bStopWhenAttachedToDestroyed,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    bool bAutoDestroy
)

Public function Static

UParticleSys...

 

SpawnEmitterAtLocation

(
    const UObject* WorldContextObj...,
    UParticleSystem* EmitterTempla...,
    FVector Location,
    FRotator Rotation,
    FVector Scale,
    bool bAutoDestroy,
    EPSCPoolMethod PoolingMethod
)

Plays the specified effect at the given location and rotation, fire and forget.

Public function Static

UParticleSys...

 

SpawnEmitterAtLocation

(
    const UObject* WorldContextObj...,
    UParticleSystem* EmitterTempla...,
    FVector Location,
    FRotator Rotation,
    bool bAutoDestroy,
    EPSCPoolMethod PoolingMethod
)

Backwards compatible version of SpawnEmitterAttached for C++ without Scale.

Public function Static

UParticleSys...

 

SpawnEmitterAtLocation

(
    UWorld* World,
    UParticleSystem* EmitterTempla...,
    const FTransform& SpawnTransform,
    bool bAutoDestroy,
    EPSCPoolMethod PoolingMethod
)

Plays the specified effect at the given location and rotation, fire and forget.

Public function Static

UParticleSys...

 

SpawnEmitterAttached

(
    UParticleSystem* EmitterTempla...,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    FRotator Rotation,
    FVector Scale,
    EAttachLocation::Type LocationType,
    bool bAutoDestroy,
    EPSCPoolMethod PoolingMethod
)

Plays the specified effect attached to and following the specified component.

Public function Static

UParticleSys...

 

SpawnEmitterAttached

(
    UParticleSystem* EmitterTempla...,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    FRotator Rotation,
    EAttachLocation::Type LocationType,
    bool bAutoDestroy,
    EPSCPoolMethod PoolingMethod
)

Backwards compatible version of SpawnEmitterAttached for C++ without Scale.

Public function Static

UForceFeedba...

 

SpawnForceFeedbackAtLocation

(
    const UObject* WorldContextObj...,
    UForceFeedbackEffect* ForceFee...,
    FVector Location,
    FRotator Rotation,
    bool bLooping,
    float IntensityMultiplier,
    float StartTime,
    UForceFeedbackAttenuation* Att...,
    bool bAutoDestroy
)

Plays a force feedback effect at the given location.

Public function Static

UForceFeedba...

 

SpawnForceFeedbackAttached

(
    UForceFeedbackEffect* ForceFee...,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    FRotator Rotation,
    EAttachLocation::Type LocationType,
    bool bStopWhenAttachedToDestroyed,
    bool bLooping,
    float IntensityMultiplier,
    float StartTime,
    UForceFeedbackAttenuation* Att...,
    bool bAutoDestroy
)

Plays a force feedback effect attached to and following the specified component.

Public function Static

UObject *...

 

SpawnObject

(
    TSubclassOf< UObject > ObjectClass,
    UObject* Outer
)

Create Object

Public function Static

UAudioCompon...

 

SpawnSound2D

(
    const UObject* WorldContextObj...,
    USoundBase* Sound,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundConcurrency* Concurrency...,
    bool bPersistAcrossLevelTransition,
    bool bAutoDestroy
)

Spawns a sound with no attenuation, perfect for UI sounds.

  • Not Replicated.

Public function Static

UAudioCompon...

 

SpawnSoundAtLocation

(
    const UObject* WorldContextObj...,
    USoundBase* Sound,
    FVector Location,
    FRotator Rotation,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    USoundConcurrency* Concurrency...,
    bool bAutoDestroy
)

Spawns a sound at the given location.

Public function Static

UAudioCompon...

 

SpawnSoundAttached

(
    USoundBase* Sound,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    EAttachLocation::Type LocationType,
    bool bStopWhenAttachedToDestroyed,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    USoundConcurrency* Concurrency...,
    bool bAutoDestroy
)

Public function Static

UAudioCompon...

 

SpawnSoundAttached

(
    USoundBase* Sound,
    USceneComponent* AttachToCompo...,
    FName AttachPointName,
    FVector Location,
    FRotator Rotation,
    EAttachLocation::Type LocationType,
    bool bStopWhenAttachedToDestroyed,
    float VolumeMultiplier,
    float PitchMultiplier,
    float StartTime,
    USoundAttenuation* Attenuation...,
    USoundConcurrency* Concurrency...,
    bool bAutoDestroy
)

Plays a sound attached to and following the specified component.

Public function Static

FMemoryReade...

 

StripSaveGameHeader

(
    const TArray< uint8 >& SaveData
)

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.

Public function Static

bool

 

SuggestProjectileVelocity

(
    const UObject* WorldContextObj...,
    FVector& TossVelocity,
    FVector StartLocation,
    FVector EndLocation,
    float TossSpeed,
    bool bHighArc,
    float CollisionRadius,
    float OverrideGravityZ,
    ESuggestProjVelocityTraceOption::Ty...,
    const FCollisionResponseParams& Re...,
    const TArray< AActor* >& Acto...,
    bool bDrawDebug
)

Native version, has more options than the Blueprint version.

Public function Static

bool

 

SuggestProjectileVelocity_CustomArc

(
    const UObject* WorldContextObj...,
    FVector& OutLaunchVelocity,
    FVector StartPos,
    FVector EndPos,
    float OverrideGravityZ,
    float ArcParam
)

Returns the launch velocity needed for a projectile at rest at StartPos to land on EndPos.

Public function Static

void

 

UnloadStreamLevel

(
    const UObject* WorldContextObj...,
    FName LevelName,
    FLatentActionInfo LatentInfo,
    bool bShouldBlockOnUnload
)

Unload a streamed in level

Deprecated Functions

Name Description

Public function Static

AActor *

 

BeginSpawningActorFromClass

(
    const UObject* WorldContextObj...,
    TSubclassOf< AActor > ActorClass,
    const FTransform& SpawnTransform,
    bool bNoCollisionFail,
    AActor* Owner
)

This function is deprecated. Please use BeginDeferredActorSpawnFromClass instead.

Public function Static

bool

 

PredictProjectilePath

(
    const UObject* WorldContextObj...,
    FHitResult& OutHit,
    TArray< FVector >& OutPathPosition...,
    FVector& OutLastTraceDestination,
    FVector StartPos,
    FVector LaunchVelocity,
    bool bTracePath,
    float ProjectileRadius,
    const TArray< TEnumAsByte< EObjectT...,
    bool bTraceComplex,
    const TArray< AActor* >& Acto...,
    EDrawDebugTrace::Type DrawDebugType,
    float DrawDebugTime,
    float SimFrequency,
    float MaxSimTime,
    float OverrideGravityZ
)

PredictProjectilePath with many parameters has been deprecated in favor of the version taking single input parameter and output result structs.

References

Module

Engine

Header

Runtime/Engine/Classes/Kismet/GameplayStatics.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback