How do I check if an editor viewport is in "game view" i.e. excluding non-gameplay objects?

When you press the G key in an editor viewport it toggles into a “game view” where non-gameplay objects such as actor sprites, splines, etc. are hidden, so you see only what will actually render during gameplay.

I’ve got an actor class which ticks in the editor to draw some debug lines showing relevant connections between actor instances. Those debug lines draw regardless of whether the viewport is in game view or not.

I tried putting this at the top of the tick, but it appears to return true regardless of the viewport state:


if(GEditor->GetActiveViewport()->GetClient()->IsInGameView()) { return; }

What is the proper way to determine if the viewport is in game view or not?