DrawDebugHelpers are Uber broken...

For whatever reason, the DrawDebugHelpers library doesn’t seem to work very well anymore. The Line Batcher appears to completely ignore Line lifetime, and most of the shapes it can draw don’t actually respect the ‘Thickness’ parameter, so most lines are actually removed by the Temporal Anti-Aliasing.

The Persistent Lines checkbox has no effect, unless you’re drawing lines on Tick and make them incredible thick, they never show up. This is the test scenario I’m using, neither the Cylinder nor the Line stay on screen for more than a fraction of a second, usually far too quickly for me to even see it.

Can these be fixed? They used to be incredible useful, but are borderline useless now for any real debugging.



void ABZGame_ProxMine::BeginPlay()
{
	Super::BeginPlay();

	if (Role == ROLE_Authority)
	{
		CachedGS = Cast<ABZGame_GameState>(GetWorld()->GetGameState());
		if (CachedGS)
		{
			GetWorldTimerManager().SetTimer(ScanRange_Handle, this, &ABZGame_ProxMine::ScanTargetRange, SearchDelay, true, SearchDelay);
		}		
	}
}

void ABZGame_ProxMine::ScanTargetRange()
{
	TArray<UBZGame_GameObjectComponent*> ObjectsInRange = UBZGame_GameInstance::GetGOCManager(this)->GetObjectTree()->GetObjectList(FVector2D(GetActorLocation().X, GetActorLocation().Y), SearchRadius);
	if (ObjectsInRange.Num() > 0) // Since it'll pick up itself!
	{
		//GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Red, FString::Printf(TEXT("Num In Range: %i"), ObjectsInRange.Num()));

		EAffiliation TeamAffiliation;
		for (UBZGame_GameObjectComponent* ObjectItr : ObjectsInRange)
		{
			DrawDebugLine(GetWorld(), GetActorLocation(), ObjectItr->GetOwnerLocation(), FColor::Red, true, 1.0f, 1, 150.0f);


			//GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Red, FString::Printf(TEXT("Name = %s"), *ObjectItr->GetGameObjectData().UnitName));

			if (ObjectItr == GameObjectComp)
			{
				continue;
			}

			/* Check for Team Affiliation */
			TeamAffiliation = CachedGS->GetTeamAffiliation(GameObjectComp->GetTeam(), ObjectItr->GetTeam());

			const float Dist = FVector::Dist(GetActorLocation(), ObjectItr->GetOwnerLocation());
			//GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Blue, FString::Printf(TEXT("GOC %s - Range = %f"), *GetNameSafe(ObjectItr), Dist));

			if (TeamAffiliation == EAffiliation::EA_Enemy)
			{
				//KillMine();
			}
		}
	}
}


Likewise In my project, the duration time of 1 second here seems to be completely ignored. the lines last forever.

FIX there is a function in the blueprints called “flush persistent Debug lines” that fixed the issue for me :slight_smile: