Capture a Screenshot in UE and Get Its File Path and Name
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 :
Now type “shot” in the command of this node.
It would look like this :
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 :
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 :
By using this exact function, you can get the latest created screenshot file name in the variable you created.
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.