RandRange not working properly.

float DistanceFromCenter = FMath::RandRange(0.0f, Radius);

When calling DistanceFromCenter I always get 0.

Please help.

How are you setting/getting Radius? Log it to make sure it’s not 0 as well.

Im setting Radius in BeginPlay

Radius = tan(BulletAngle) * MaxRange;

MaxRange is UPROPERTY and is set in header.
BulletAngle is set in header as well.

Still seems reasonable. If tan(BulletAngle) returns zero, it’s still going to be zero.

BulletAngle is not set to 0

Ok, it turned out that it was set to 0. Thanks for help.