SET_FLOAT_STAT how to get the value of a float set by SET_FLOAT_STAT?

i want to get access to STAT_UnitFrame/STAT_UnitRender value from c++.
how to do it?

One way to get access to these values specifically (FrameTime, RenderThreadTime, GameThreadTime and GPUFrameTime) is through the FViewportClient. It has a function GetStatUnitData() which returns FStatUnitData* which in turn has those members (and a few more).


UWorld const * const World = /*get world from somewhere*/;
if (World && World->GetGameViewport() && World->GetGameViewport()->GetStatUnitData())
{
	World->GetGameViewport()->GetStatUnitData()->FrameTime;
	//...
}

This is always 0. What am I doing wrong? I put it on tick in a pawn that is being spawn in level, I get the output in log but it is always 0.00000 :confused:

I have no idea anymore.