UGameplayStatics::BlueprintSuggestProjectileVelocity

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

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 BlueprintSuggestProjectileVelocity
(
    const UObject * WorldContextObject,
    FVector & TossVelocity,
    FVector StartLocation,
    FVector EndLocation,
    float LaunchSpeed,
    float OverrideGravityZ,
    ESuggestProjVelocityTraceOption::Type TraceOption,
    float CollisionRadius,
    bool bFavorHighArc,
    bool bDrawDebug
)

Remarks

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

Returns

Returns false if there is no valid solution or the valid solutions are blocked. Returns true otherwise.

Parameters

Parameter

Description

TossVelocity

(output) Result launch velocity.

StartLocation

Intended launch location

EndLocation

Desired landing location

LaunchSpeed

Desired launch speed

OverrideGravityZ

Optional gravity override. 0 means "do not override".

TraceOption

Controls whether or not to validate a clear path by tracing along the calculated arc

CollisionRadius

Radius of the projectile (assumed spherical), used when tracing

bFavorHighArc

If true and there are 2 valid solutions, will return the higher arc. If false, will favor the lower arc.

bDrawDebug

When true, a debug arc is drawn (red for an invalid arc, green for a valid arc)

Select Skin
Light
Dark

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