DrawDebugString duration should be 0

This is a minor nit, but the duration passed to DrawDebugString should be 0, instead of DeltaTime, that’s why the text is flashing. Since the frame is rendered once per tick, passing zero means it will be removed (and then replaced by us) for each frame render.

Passing in DeltaTime means we pass in the amount of time since the last frame render. That delta is variable, so when DeltaTime for the previous frame is more than the current delta, the previous DrawDebugString call persists an extra frame, causing duplicate strings to appear for a frame or two.


Thanks for sharing.


Privacy & Terms