UKismetMathLibrary::RandomUnitVectorInConeInDegrees

Returns a random vector with length of 1, within the specified cone, with uniform random distribution.

Windows
MacOS
Linux

References

Module

Engine

Header

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

Include

#include "Kismet/KismetMathLibrary.h"

Syntax

static FVector RandomUnitVectorInConeInDegrees
(
    FVector ConeDir,
    float ConeHalfAngleInDegrees
)

Remarks

Returns a random vector with length of 1, within the specified cone, with uniform random distribution.

Parameters

Parameter

Description

ConeDir

The base "center" direction of the cone.

ConeHalfAngleInDegrees

The half-angle of the cone (from ConeDir to edge), in degrees.

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