0 votes

For context, I'm new to Godot and am trying to create a rhythm game. Similar to Dance Dance Revolution, I would like a video playing in the background while the user interacts with the 3D scene in front of the video (where the 3D scene has a track/notes similar to what you would see in Guitar Hero). I have tried adding a VideoPlayer to a control node, but the video always plays in front of the 3D scene instead of behind it. What I'm aiming for is to have the video continuously playing in the background behind the 3D scene. How would I go about this implementation? Thanks in advance for any help!

Godot version 3.2.3
in Engine by (30 points)

2 Answers

0 votes

I would:
Create a Sprite3D as background.
Create a Viewport.
Put VideoPlayer in a $Viewport.
(Remember to set Viewport.size to fit the video.)
Create a ViewportTexture for $Sprite3D.texture which links to the $Viewport above.
(You need to $Viewport.flip_y to ture if the video is upside down.)


by (311 points)
0 votes

So I was able to get this working by using this wonderful example (main difference being that I used a videoplayer in the Viewport). The only problem here is that performance is non-trivially slow, and my game grinds to a halt until the video stops playing. Current workaround was to scrap the video (169Mbs for those curios of the size), use a sprite to project on the background (or in the GitHub project, the ViewportQuad node), and use a shader for it that looks like a moving background.

by (30 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.