# start screen capture
var image = get_viewport().get_texture().get_data()
Believe it or not, now it stopped saving screenshots. When I press PrintScreen, the program stutters a little like before, which seems it's saving the screenshot, but when I look inside it, there's no screenshot. :(
And before someone asks, yes, I have the permission for the folder and there's no file in there that cannot be overwritten.