- Home /
[2D] Place video in the background
Hello,
I have a canvas with buttons, texts and other UI elements. I want to add a background that is acutally a video. I am using the video player component to play it. No matter what kind of render mode I set, it just always is rendered over everything else. However, I want my buttons to be in the foreground. Changing the order in hierachy didn't fix it. Does anyone know how to deal with this issue?
Best regards!
Answer by Tario · Apr 29, 2020 at 03:28 PM
All UI elements have a Z height as well as their position in the hierarchy. Have you tried messing with that? It's in the Rect Transform. Try setting it really high and then really low. I can't remember which one is further away from the camera.
I have tried that too. Apparently if you spawn a video player it will create an empty 3D game object with the component attached to it, not an UI element. If I add the component to an actual UI element it won't display anything anymore.
Your answer
Follow this Question
Related Questions
Choosing between canvas and normal 2D gameobjects 0 Answers
2D UI in 3D space 3 Answers
How to display UI Text on GameObject in script? 0 Answers