Screencapture2d + dynamic material: different in PIE and Standalone Game

(I’m a starter in UE4 so my question might be trivial, sorry)

I’m trying to make basic portals with ScreenCapture2d and a material with a dynamic texture. In PIE everything works as expected, but in Standalone Game the portal texture remains the default, as if it wasn’t updating or something like that.

To reproduce:

Create a First Person Template

I’m using these assets to create 2 portals

Place portals and assign them to each other ( “other portal” property)

Other posts suggested that I set the material property : used with static lighting, and I did.
Am I missing something?

See attached image.

Cheers

Found the root of the problem. In case anyone runs into the same mistake, i called the GetViewportSize in the BeginPlay event, and that returned (0,0), you have to avoid that.