- Home /
Snapping image and display it on next scene
How do I capture a photo on unity and display it on next scene on run time? FYI: I am building an augmented reality app and using my device's camera.
Answer by anilhdas · Mar 22, 2017 at 03:09 PM
So I assume that you're using a WebCamTexture in an empty plane to render the camera feed in AR mode (correct me if I'm wrong).
At the frame you want to snap the image (for eg, when the user presses the capture button), convert the WebCamTexture into a byte array.
Then you can store the byte array into playerprefs or static variable of a class which is not destroyed while the scene is changed.
And in the next scene, you can convert the byte array back to a Texture2D and display it wherever you want.
Answer by Mikzalianz · Mar 24, 2017 at 07:56 PM
@anilhdas thank you. It's working :)
Happy to hear it helped you. Cheers. Happy Program$$anonymous$$g..