The DrawDebugString() function has to versions. One is the actual function to display a string of debug text in non-Shipping builds, and the other is an empty function that is used in Shipping builds. However, the signature for each of these versions of the function is different. The normal function takes 8 parameters, but the empty Shipping version of the function only takes 7 parameters. This will result in a Shipping build failing if this function is called with 8 parameters (and it is not guarded by something like #if !UE_BUILD_SHIPPING).

No. The same behavior occurs in 4.20.3.

Steps to Reproduce
  1. Create a new Basic Code project.
  2. Add a new Actor class to the project.
  3. Include the DrawDebugHelpers.h file in the new Actor's .cpp file.
  4. In one of the included functions of the new Actor class (eg. BeginPlay()), add a call to DrawDebugString() using all 8 parameters.
    • eg: DrawDebugString(GetWorld(), FVector(0.f, 0.f, 0.f), TEXT("This is my test text."), nullptr, FColor::MakeRandomColor(), 1.f, false, 1.f);
  5. Build the project for DevelopmentEditor.
  6. Once the first build completes, build the project for Shipping.

The Shipping build fails with an error stating that DrawDebugString() does not take 8 parameters.

The Shipping build completes successfully.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-71998 in the post.

Login to Vote

ComponentUE - Foundation - Core
Affects Versions4.
Target Fix4.23
Fix Commit5652117
Main Commit6838042
CreatedMar 26, 2019
ResolvedMar 29, 2019
UpdatedAug 13, 2019
View Jira Issue