Is there a draw limit to DrawDebugString?

Hi all

I think the title probably contains all I need to ask, but just in case here’s some context:

I’m creating debug draw helpers as I go along so when I get to testing I can switch on/off the visual representation of what’s going on to help me.

Using DrawDebugString I can’t seem to print more that a few hundred to the screen.

I’ve tested it a few different ways and when I replace DrawDebugString with DrawDebugBox it draws everything without a problem.

Below is my test example in the player character that I’ve set up to an action key, it prints about 125 I think.

I’d really appreciate feedback on if I’ve just hit the limit or if I’m doing something wrong. I can’t find anything about limits anywhere. Starting to look through the C++ definitions to see if I can find something before I look for another method.

By the way I’m using C++ and Blueprints so either route for advise will be helpful.

Thanks in advance for your time!

1 Like

There is a limit. By default it’s 128 but you can set it through the console command

r.DebugSafeZone.MaxDebugTextStringsPerActor

to any number you like. 0 is for no limit (but will tank your fps very quickly).

5 Likes

Perfect, thanks Grim!

1 Like