Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UGameplayStatics
Description
Returns the launch velocity needed for a projectile at rest at StartPos to land on EndPos. Assumes a medium arc (e.g. 45 deg on level ground). Projectile velocity is variable and unconstrained. Does no tracing.
| Name | SuggestProjectileVelocity_CustomArc |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h |
| Include Path | #include "Kismet/GameplayStatics.h" |
| Source | /Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp |
UFUNCTION (BlueprintCallable, Category="Game",
DisplayName="Suggest Projectile Velocity Custom Arc",
Meta=(WorldContext="WorldContextObject", AdvancedDisplay="OverrideGravityZ, ArcParam"))
static bool SuggestProjectileVelocity_CustomArc
(
const UObject * WorldContextObject,
FVector & OutLaunchVelocity,
FVector StartPos,
FVector EndPos,
float OverrideGravityZ,
float ArcParam
)
Parameters
| Name | Remarks |
|---|---|
| OutLaunchVelocity | Returns the launch velocity required to reach the EndPos |
| StartPos | Start position of the simulation |
| EndPos | Desired end location for the simulation |
| OverrideGravityZ | Optional override of WorldGravityZ |
| ArcParam | Change height of arc between 0.0-1.0 where 0.5 is the default medium arc, 0 is up, and 1 is directly toward EndPos. |