How can I upload images and video in a 3D game during the gameplay?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rob1980

Hi everyone!
I’m developing a 3D game in which the player has to change the image of a billboard, replacing it with another image uploaded from a device.
So I was wondering: is it possible to insert, in a 3D game (during the gameplay, of course), an image or video uploaded from our device (pc, smartphone, etc.)?
Thank you for your answers!

I haven’t tried, but it might be possible. Try it on PC first.

var image = “C:/Users/***/Desktop/image_1.png” # for PC path

ramazan | 2022-01-22 15:21

:bust_in_silhouette: Reply From: DaddyMonster

Add a Sprite3D node as a child of your phone mesh and position. For images, all you have to do is drag the image into the texture on the editor and you’re done.

To play a vid, add a Viewport as a child of the sprite and then a VideoPlayer as a child of that. Add a new viewport texture in the inspector of your Sprite3D. On the viewport set the render target to v flip. You might have to hit keep 3d linear, if you get shading artefacts do that. Then set the resolution to match whatever your video is. That’s the size value.

Touch wood that should work. Any issues let me know.

:bust_in_silhouette: Reply From: Rob1980

I found the solution! I add a FileDialog node, by which I can to import the image I want, and finally I can apply it on my Sprite node.