+2 votes

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!

Godot version 3.3.4
in Engine by (96 points)

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

2 Answers

0 votes
Best answer

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.

by (96 points)
+2 votes

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.

by (2,156 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.