Different behaviour of FPreviewScene when play in "SelectedViewport"/"StandaloneGame"/...

Hello, I am using FPreviewScene to create a preview world and render it to a widget. I am using UE4.27 and Genenrally I am following this serial videos (Create a Headshot Renderer 01 Setup the Preview Scene - YouTube).

While, strangely, my code works well when play in “Standalone Game”/“Mobile Preview ES 3.1”. But in “Selected Viewport”/“New Editor Window”/“Simulate” modes, the captured texture is rendered firstly but does not update with tick. With debugging breakpoints, I am sure the tick/UpdateDeferredCaptures/NativePaint functions are called at a normal frequence. It seems that in some kinds of editor modes at somewhere the old data is kept and not refreshed.

I also test it on UE5.1, more strangely, it works on well in PIE and SelectedViewport, but does not update in “Mobile Preview ES 3.1”/“Standalone” mode. The shipping built android version completely does not show the preview world.

I have no ideas about what really causes these phenomenons. I know UE seems dislike multi-world, so is FPreviewScene a really shippable feature now?

Could anyone help me figure out what causes the problems and how to solve/walk-around it?

Though a lot of time has passed, there is still no correct answer :sweat_smile:

In order to solve this problem, I checked the internet about FPreviewScene and checked if CaptureComponent is working correctly, CaptureComponent’s rendering flow, and finally locked that the problem is in the UWorld parameter required for rendering.
I then went back to the UWorld information and narrowed the problem down to UWorld’s InitWorld.
Up to this point I re-looked at how FPreviewScene is new UWorld and Init.
Finally, I was able to pinpoint the bEditor in the FPreviewScene construction function’s ConstructionValues parameter.

class ENGINE_API FPreviewScene : public FGCObject
{
public:
	struct ConstructionValues
	{
		ConstructionValues()
			......
			, bEditor(true)
		{
		}
		......
	}
	FPreviewScene(ConstructionValues CVS = ConstructionValues());
}

Yes, just new ConstructionValues() and set bIsEditor to False will solve the problem.

Why did I say that much? Because I’m Dave from PVZ.