How to take a picture in roblox and use it in game?

So I’m not 100% what category this would even be under, but I want to make it so a user can capture a picture in-game and then save the image in a variable or some kind of file, but all in the game?
Hypothetically, let’s assume the user has a camera, and they take a picture. Now I want to make it so the user can print that picture out and show it to others. And it should be like the equivalent of a screenshot, just what the users’ camera sees.

Does anyone have any ideas assuming this is possible?

You could save the entirety of workspace and put it into a ViewportFrame with the camera that has the player camera’s position. The only downside of this method is you will see no skybox, and the image will be rendered on the lowest quality.

1 Like

This could be possible by taking the user’s camera position and the map and aligning it accordingly to what the rotations and positions would be in a viewport frame. Although, I’m not sure how to pull this off as im not experienced in viewports so you may have to use the Roblox Studio wiki for some clues.

With this, if you want to store it somewhere, you can use Serialization How to save parts, and the idea of Serialization

1 Like

As a potential optimization to this, maybe you could include only parts that are in view of the player’s screen within a certain range of the player. (You would probably just get the camera’s direction and save things on the same side facing the player’s direction, and limit it to something like 1,000 studs.)

Not possible, if you really want to do this the only way are viewport frames and cloning the whole workspace and parenting it to the ViewportFrame is just really bad. First of all, if you use Terrain it wouldn’t work since ViewportFrame do not render terrain.

I wanted to achieve this before to make a loading screen, but there is just not a performant way. Roblox should add a function to the camera named GetImage() to retrieve an unique id representing a picture that we can use in decals, textures, imagelabel, etc…

2 Likes

Agreed. I suppose it will not be possible to do efficiently, as what I plan to do with it will require a lot of “picture taking,” and cloning the whole workspace seems inefficient and laggy.

1 Like

yeah i think i wont be able to do it because it would need to include terrain and skybox etc. really sucks they don’t have some sort of feature for this.