- int32 MinNumSegments = 1;
- int32 MaxNumSegements = 20;
- int32 Segments = 16;
- int32 ClampedSegments = (FMath::Clamp(Segments, MinNumSegments, MaxNumSegements));
- float AngleInc = 360.f / Segments;
- FVector Forward = GetActorForwardVector();
- FVector ActorLocation = GetActorLocation();
- for (int32 i = 0; i < ClampedSegments; i++)
- {
- UE_LOG(LogTemp, Warning, TEXT("In loop: %i"), i);
- float Angle = i * AngleInc;
- FRotator Rotate{0, Angle, 0};
- FVector RotatedVector = Rotate.RotateVector(Forward);
- FVector End = RotatedVector * 500 + ActorLocation;
- DrawDebugLine(GetWorld(), GetActorLocation(), End, FColor::Red, false, 10.f, 0, 5);
- }