#How to make a video the background of a scene in Unity
1 messages · Page 1 of 1 (latest)
So right click in your asset folder and create a Render texture (Give it the dimensions you need)
Name it whatever you want
Then create a video player in your scene (if you don't already have one)
Then assign the render texture assign the render texture as the Target Texture in the Video player
Then inside your Canvas Create a Raw Image (this is where your video will be player)
Then select it and assign the render texture in the Texture field of the Raw Image
That should give you a playing video when you start the game
If you want it to play on a 3d obj assign the render texture as the input texture to the material
oh hello UV
This was the only thingy left which we did fix
Anyways try redoing it
nono thats not the same
that was a different issue
not issue i mean, another thing that we did
Lemme know what I current issue is after you follow the steps
If you have already deleted the previous stuff there's no point talking about it
does not work? do ineed to create a anew canvas
because i already have a canvas
used for my pause menu
wait nvm
it works
but why is it covering everything?
i dont want it to coverall of my game
Needs to be behind everything
So put it at the top under the canvas
Objects in the canvas will be rendered on top of each other
Thus the object at the top will be covered by objects below that that
i put it at the top of the canvas but it still covers everything
also how to play multiple videos in the same gameobject?
i can only play one even though i have multiple video players
Well make different render textures and assign and reassign them based on your needs
Could you send a screenshot of the hierarchy and the scene view of how to looks
And are there are any other canvases?
no
Hm what you can try and do
Hm what you can try and do is
Have it on a different layer and make 2 cameras one for rendering the video and one for the rest of the ui
So the other camera will just render the video so set the layer culling as only the layer of the video
And remove the layer from.the second camera
Then simply set it as an overlay
oh i think
my camera acts as the background
yes it acts as the background @lunar nova
Doesn't matter
Do this properly should work
what do you mean by 'have it'? the canvas or the video player
the raw image
ok
wdym by remove the layer from the second camera
Remove it from the culling layer list
by culling layer you mean culling mask right?
ook
this correct? my rawimage is the water layer
yes this should the the camera 1 and then simply have the other camera which renders all layers except water
and then change it's depth
Camera's depth in the camera rendering order.
Cameras with lower depth are rendered before cameras with higher depth.
Use this to control the order in which cameras are drawn if you have multiple cameras and some of them don't cover the full screen```
So set this camera's depth to 0 and the other one as 1
So it's overlayed on top
still
i only see the background (whcih actally isnt even moving even tho it is a gif file)
gif's don't work use a mp4 or other video formats
are you sure you have done everything correct?
sorry i meant mp4
i converted it from a gif file
to mp4
well it should move when the game starts
have you assigned the render texture and told the video player to play at start?
and set it to loop
Nice
hey @lunar nova how would it work with a scene that has no camera
i tried repeating what we did here
but all my ui dsiappeared
it won't work
oh so i need a camera
my scene doesnt have a camera tho
it does
nvm i got it working
no im talking about a different scene
if it does not the game view would say no camera and thus not render anything
A scene can't be used without a camera
@lunar nova im trying to add an image background to my scene, but when i attach it in the background covers the full screen?
it worked before by putting a Background panel at the top of the hierarchy, but now when I try replicate it, it doesnt work?
Yes just add an image to a image or raw image and set the anchor and scale points to fill the entire screen
Well aren't your characters sprites?
Use the camera technique we used earlier
As sprites and ui elements are not meant to work together
See if the camera layer one works