Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/Kismet > API/Runtime/Engine/Kismet/UKismetMathLibrary > API/Runtime/Engine/Kismet/UKismetMathLibrary/RandomUnitVector-_2
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.h |
| Include | #include "Kismet/KismetMathLibrary.h" |
| Source | /Engine/Source/Runtime/Engine/Private/KismetMathLibrary.cpp |
static FVector RandomUnitVectorInConeInRadiansFromStream
&40;
const FRandomStream & Stream,
const FVector & ConeDir,
float ConeHalfAngleInRadians
&41;
Remarks
Returns a random vector with length of 1, within the specified cone, with uniform random distribution.
Parameters
| Name | Description |
|---|---|
| ConeDir | The base "center" direction of the cone. |
| ConeHalfAngleInRadians | The half-angle of the cone (from ConeDir to edge), in radians. |
| Stream | The random stream from which to obtain the vector. |