Skip to main content
Skip table of contents

Capture a Screenshot in UE and Get Its File Path and Name

Learn how to take a screenshot and get its path and name.

1. Take a screenshot

  • Create a simple custom event and in the event graph, right-click and search for “Execute console command” and get it.

It would look like this :

Image 1. Screenshot in Unreal Engine: Execute console command.

  • Now type “shot” in the command of this node.

It would look like this :

Image 2. Screenshot in Unreal Engine: Now type “shot.

Now whenever you call this event, Unreal Engine will take a screenshot and save it.

2. Get the path of the screenshot

  • Get “Screen shot Dir” node in the event graph and add an append node with it.

  • Add four entries to it.

  • Type “ScreenShot” in the second entry.

  • Make a variable of the third entry and name it whatever you like such as screenshot number give it value “00000”.

  • From the Return Value, you can put a check for “FileExists” and connect it to a branch.

It would look like this :

Image 3. Get the path of the screenshot: search “Screen shot Dir”.

Note: In the append node you need to put the name of the screenshot file and make sure you also add the extension of the file such as (.png).

You might need to run a loop which will check if the file with same name exists or not.

What this loop should do is :
If ScreenShot00001.png exists, go for next number ScreenShot00002.png. If that exists, search for ScreenShot00003.png.

If it doesn't exist, it means that the previous number (ScreenShot00002.png) was the latest screenshot that was taken and saved. So just use that file name.

Or you can try to copy this function below :

Image 4. Screenshot in Unreal Engine: Copy this function.

By using this exact function, you can get the latest created screenshot file name in the variable you created.


Was this article helpful? Comment Below. Let us know your feedback.

Need help? Contact Support

Submit a new request at E3DS support portal.

Requests sent on weekends will not be addressed until the following business day.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.