Skip to main content
Skip table of contents

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

This document is a tutorial on how to take a screenshot and get its path.

How to take a screenshot:

It is really simple to take a screenshot in Unreal Engine. In order to do that, create a simple custom event and in the event graph, right-click and search for “Execute console command” and get it.

It would look something 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.

How to get the path of the screenshot:

In order to get the path of the screenshot folder, you need to 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.

Need help? Contact Support

If you still need help, contact support to get your issue resolved quickly.

Submit a new request at E3DS support portal or send an Email at support@eagle3dstreaming.com.

Seek advice. Connect with others. Share your experiences. Join our lively Community Forum today.

JavaScript errors detected

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

If this problem persists, please contact our support.