Screenshot funcionality in packaged game?

So I tried to create the screenshot functionality using UMG Menu but on clicking the button in the packaged game it crashes the game.
Any idea of how to set up a working screenshot button? Sorry if it’s a silly question but still learning.