RealDocs

UKismetMathLibrary::RandomUnitVectorInEllipticalConeInDegrees

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Degree-unit wrapper around RandomUnitVectorInEllipticalConeInRadians. Returns a random unit vector inside an elliptical cone with independent horizontal and vertical spread angles.

Caveats & Gotchas

  • MaxYaw and MaxPitch are half-angles, not full arc widths. A value of 10 gives a ±10° spread (20° total arc), not ±5°.
  • Inline wrapper only — converts degrees to radians and delegates. Not thread-safe for the same reasons as the radians variant.

Signature

static FVector RandomUnitVectorInEllipticalConeInDegrees(FVector ConeDir, float MaxYawInDegrees, float MaxPitchInDegrees)

Parameters

Name Type Description Default
ConeDir FVector Center direction of the cone.
MaxYawInDegrees float Maximum horizontal deviation from ConeDir, in degrees.
MaxPitchInDegrees float Maximum vertical deviation from ConeDir, in degrees.

Return Type

FVector

Example

Elliptical spread for a beam weapon C++
FVector AimDir = GetActorForwardVector();
FVector BeamDir = UKismetMathLibrary::RandomUnitVectorInEllipticalConeInDegrees(
    AimDir, 12.f, 4.f);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.