Starting PIE programmatically

I got this working in 5.4 by using the following:

FPlayWorldCommands::GlobalPlayWorldActions->ExecuteAction(FPlayWorldCommands::Get().PlayInViewport.ToSharedRef());

It requires the following include and a module dependency on ‘UnrealEd’.

include “Kismet2/DebuggerCommands.h”