UGameplayStatics::Blueprint_PredictProjectilePath_ByObjectType

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

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h

Include

#include "Kismet/GameplayStatics.h"

Source

/Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp

Syntax

static bool Blueprint_PredictProjectilePath_ByObjectType
(
    const UObject * WorldContextObject,
    FHitResult & OutHit,
    TArray< FVector > & OutPathPositions,
    FVector & OutLastTraceDestination,
    FVector StartPos,
    FVector LaunchVelocity,
    bool bTracePath,
    float ProjectileRadius,
    const TArray< TEnumAsByte< EObjectTypeQuery > > & ObjectTypes,
    bool bTraceComplex,
    const TArray< AActor * > & ActorsToIgnore,
    EDrawDebugTrace::Type DrawDebugType,
    float DrawDebugTime,
    float SimFrequency,
    float MaxSimTime,
    float OverrideGravityZ
)

Remarks

Predict the arc of a virtual projectile affected by gravity with collision checks along the arc. Returns a list of positions of the simulated arc and the destination reached by the simulation. Returns true if it hit something.

Returns

True if hit something along the path if tracing for collision.

Parameters

Parameter

Description

OutPathPositions

Predicted projectile path. Ordered series of positions from StartPos to the end. Includes location at point of impact if it hit something.

OutHit

Predicted hit result, if the projectile will hit something

OutLastTraceDestination

Goal position of the final trace it did. Will not be in the path if there is a hit.

StartPos

First start trace location

LaunchVelocity

Velocity the "virtual projectile" is launched at

bTracePath

Trace along the entire path to look for blocking hits

ProjectileRadius

Radius of the virtual projectile to sweep against the environment

ObjectTypes

ObjectTypes to trace against, if bTracePath is true.

bTraceComplex

Use TraceComplex (trace against triangles not primitives)

ActorsToIgnore

Actors to exclude from the traces

DrawDebugType

Debug type (one-frame, duration, persistent)

DrawDebugTime

Duration of debug lines (only relevant for DrawDebugType::Duration)

SimFrequency

Determines size of each sub-step in the simulation (chopping up MaxSimTime)

MaxSimTime

Maximum simulation time for the virtual projectile.

OverrideGravityZ

Optional override of Gravity (if 0, uses WorldGravityZ)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss