How to get a screenshot of what the player is viewing?

Hello. I was wondering if there was a way to get what the player is viewing. Let me explain. When you take a screenshot, it takes a picture of whatever you’re viewing on your device right? I was wondering if there was a way to have that in roblox. The pictures would be viewport frames I guess but I’m looking for another way to that too. All I want is a script to make this sort of screenshot function. I couldn’t find anything on the devforums that asks something like this either. The screenshot function should be able to get anything on the screen, even in first, second, or third person.

You can use raycasts to manually create a picture out of colors of the instances each ray hits. It’s difficult to create for some people and may lag the device.

1 Like

@absentdenik I don’t want it to be laggy, but there might be a way to clone the camera or something like that.

You can save camera CFrame and every object in the workspace, it wont be any better. Theres no other ways.

EDIT: You can optimize the workspace saving part by getting instances only visible on the screen using workspace.CurrentCamera:WorldToViewportPoint(), there will be 2 arguments, the second one is the bool that will indicate if the instance is visible on the screen. @Prerak12345678

I may have to go and look at the camera api later and see what I can do.