DrawDebugLine not pointing to expected location

Hi

I called DrawDebugLine(), expecting it stretch 100 units in the direction my CapsuleCollider is facing. However, it seems to always point towards the world center, or very close to it. I’ve tried modifying the vector params, but no combination gave me what i was looking for.

FVector End = GetActorForwardVector() * 100.f;

	DrawDebugLine(GetWorld(), GetActorLocation(), End, FColor::Red, true);

Result

Any help would be very appreciated. Thanks!

Found the solution

I had to add the Actors current location to the end position calculation

FVector End = GetActorLocation() +  GetActorForwardVector() * 10000.f;

	DrawDebugLine(GetWorld(), GetActorLocation() , End, FColor::Red, true);
1 Like