I know that ( GetActorLocation() + (GetActorForward() * 40) ) will represent a line starting from the actor going forward for 40 units.
But, The problem is whenever I rotate the object; the vectors don’t rotate. I want them to rotate as I rotate the object
Here’s the code and run
float Degrees = ThresholdDegree; // 90
float Radian = UKismetMathLibrary::DegreesToRadians(Degrees/2);
FVector Line1 = FVector(FMath::Cos(Radian), FMath::Sin(Radian), 0);
FVector Line2 = FVector(FMath::Cos(-Radian), FMath::Sin(-Radian), 0);
DrawDebugLine(GetWorld(), GetActorLocation(), GetActorLocation() + (Line1 * 50), FColor::Green, false, 0.0f); // Line1
DrawDebugLine(GetWorld(), GetActorLocation(), GetActorLocation() + (Line2 * 50), FColor::Green, false, 0.0f); // Line2
DrawDebugDirectionalArrow(GetWorld(), GetActorLocation(), GetActorLocation() + (GetActorForwardVector() * 50), 1, FColor::Cyan, false, 0.0f, 0, 0.2); // Draw forward vector