Hi Unrealers,
I’m trying to access individual frames of gameplay - I essentially need to grab 30 screenshots per second. I’ve been able to do this by calling ReadPixels from inside a UObject’s Tick function, and it works fine in the editor. Outside the editor, however, calling ReadPixels results in a null reference ("Access violation reading location 0x0000000000000020).
Has anyone found a way to copy a frame of gameplay outside the editor, a la ReadPixels or GetViewportScreenShot? Something like ReadPixels, which saves a Viewport’s output as a TArray, would be perfect as long as it doesn’t cause crashes. Also looking into alternative strategies.
Sidenote: I’ve seen somebody on AnswerHub who extended the Viewport class to do something like this, but
- that seems more complex than it needs to be, just to copy what’s on the screen, and
- their solution is locked behind a permission gate on some older forums.