This plugin solves this problem on windows, perhaps help you:
Screenshot as Texture2D in Code Plugins - UE Marketplace (unrealengine.com)
This plugin solves this problem on windows, perhaps help you:
Screenshot as Texture2D in Code Plugins - UE Marketplace (unrealengine.com)