#How to make a video the background of a scene in Unity

1 messages · Page 1 of 1 (latest)

fading pulsar
#

i tried following tutorials, but i cannot seem to get the texture working? or do i need to assign tehj video player to a square?

lunar nova
# fading pulsar i tried following tutorials, but i cannot seem to get the texture working? or do...

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

fading pulsar
#

oh hello UV

lunar nova
#

Hello 👋

#

Didn't we already do the same before?

#

Has it stopped working?

fading pulsar
#

yeah it didnt work

#

so i got rid of it

#

but now i need to redo it

lunar nova
fading pulsar
#

nono thats not the same

#

that was a different issue

#

not issue i mean, another thing that we did

lunar nova
#

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

fading pulsar
#

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

lunar nova
#

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

fading pulsar
#

also how to play multiple videos in the same gameobject?

#

i can only play one even though i have multiple video players

lunar nova
lunar nova
lunar nova
#

And are there are any other canvases?

fading pulsar
lunar nova
# fading pulsar 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

fading pulsar
#

oh i think

#

my camera acts as the background

#

yes it acts as the background @lunar nova

lunar nova
#

Doesn't matter

fading pulsar
fading pulsar
#

ok

fading pulsar
lunar nova
fading pulsar
#

by culling layer you mean culling mask right?

#

ook

#

this correct? my rawimage is the water layer

lunar nova
#

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

fading pulsar
#

still

#

i only see the background (whcih actally isnt even moving even tho it is a gif file)

lunar nova
lunar nova
fading pulsar
#

i converted it from a gif file

#

to mp4

lunar nova
fading pulsar
lunar nova
#

Set the canvas as screen space camera and assign the main camera

fading pulsar
#

why is my video notmoving?

#

it workled tho the character and stuff is on top

lunar nova
#

and set it to loop

fading pulsar
#

ah

#

works now

lunar nova
#

Nice

fading pulsar
#

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

fading pulsar
#

oh so i need a camera

lunar nova
#

A scene can never not have a camera

#

then it won't render anything

fading pulsar
#

my scene doesnt have a camera tho

lunar nova
fading pulsar
#

nvm i got it working

fading pulsar
lunar nova
#

A scene can't be used without a camera

fading pulsar
#

@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?

lunar nova
fading pulsar
#

but then the image covers all of my game?

#

i can no longer see my character again

lunar nova
#

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