Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Kismet > UGameplayStatics
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 |
static bool Blueprint_PredictProjectilePath_ByTraceChannel
&40;
const UObject &42; WorldContextObject,
FHitResult & OutHit,
TArray< FVector > & OutPathPositions,
FVector & OutLastTraceDestination,
FVector StartPos,
FVector LaunchVelocity,
bool bTracePath,
float ProjectileRadius,
TEnumAsByte< ECollisionChannel > TraceChannel,
bool bTraceComplex,
const TArray< AActor &42; > & ActorsToIgnore,
EDrawDebugTrace::Type DrawDebugType,
float DrawDebugTime,
float SimFrequency,
float MaxSimTime,
float OverrideGravityZ
&41;
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 (if tracing with collision). True if hit something along the path (if tracing with collision).
Parameters
Name | 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 |
TraceChannel | TraceChannel 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) |