Monster shadow

VIDEO

Placing 3D objects on a Unity canvas

Description:
Ever wondered how to add a 3D object to your Unity canvas? This is great for screens like weapon select, inventories, skins, etc.
ADD A COMMENT

Tarodev
Helpful? *Let me know* so I can continue making useful content!
Fabian Ghenof
hello sir, for the other cubes i have to make a separate cameras ?
kechao ou
Very useful, thank you very much
Igor Novik
@Bplus Tell me, please, what different will be in URP case?
Bplus
In Unity 2021 and with URP things are working a bit differently, but it helped me. Would love to watch more content of you :)
dheeraj singh
thank you sir
Marc Campos Pons
Thank you, you saved me.
Marcus Marcus
Doesn't work. The model stays in world space and does not stick to the UI. EDIT It's because I'm using ARFoundation which also has its own camera. How can I make both cameras work together?
JensonTM
damn, exactly what i was looking for
Psychologia & Gaming
Cool! Clear and fast!
古檸檬
Thank you for the tutorial, I've successfully made a button with 3D object on it. Is there any way to mask it when it was scrolled out from a scroll view?
Ismayil Mammadov
Thanks mate, helped a lot!
PixelDust
i was skeptical u were about to use rendertextures but this worked out way better, thanks
Claudio Vasquez
How do I hide the canvas with one click?
MecsiMoto
Please keep doing this kind of content, its kind of underrated the well explained and on point this mini tutorial was.
Pavlo Viter
supercool! thx
sali
Second time in a day 😂 So ironic😊 This is yet another thing that i was trying to do on my splash screen UI/Canvas. Thank you again.
Kyal Huntley
Love it. Straight to the point solved my problem 😊
BlazeDrag
I'm running into an issue where any 3D object for some reason acts as a sort of culling mask for my UI. Instead of showing up on the UI, it makes whatever part of the UI it would cover up, transparent. So like for example if I have a donut in my UI, the UI now looks like it has a donut shaped hole in it instead of actually showing the donut. I've been trying to fix this for hours and I have no idea what's causing it
Péter N.
just what I needed. Not lets implement this :D
Péter N.
Tip: if you make further tutorials, maybe you should change to some newer Unity version - you are using 2019
Péter N.
oupsz, I don't have clear flags...
Hongo Plays
how can I do this with Cinemachine?
Tarodev
Cinemachine shouldn't change the technique at all. Is something preventing you from doing it?
Inconsistent Gaming
THIS IS AWESOME, THANK YOU
Matthew Kimbrough
Great info! I wish I would have known about this last year when I accomplished something similar using a lot of hacky and inefficient render textures.
Simsinnati
Just in case anyone else gets stuck on this like I did: Don't forget to set your canvas to the UI layer as well, otherwise it won't be visible to the canvas camera.
SEE ALL COMMENTS


Transcript:

hey guys so you've got your game made you've got a ui and you've got some ui
elements let's change this one here to be a 3d
object so the first thing you need to do is go
to your canvas and change it from overlay to camera now it's telling
us we need a camera to render this canvas so let's create a brand new
camera and we'll call it canvas camera
now on this camera change the clear flags to depth only
change the culling mask to only render the ui
change it from perspective to orthographic
go back to your canvas and drag in that new canvas camera
change plane distance down to about 10. and now we can grab our camera and we
can move it to the side a little bit just to keep it away
now so next is to change this image
to a 3d object so let's delete the image and i'll create a new empty here and
i'll call it object parent and i'll just move it in front a
little bit like that now i've got this cube here
it's just a cube with a script on it that rotates the cube
nothing different than just a normal cube
i'm just going to drag that on just going to zero it out to make it in the
center and now i'm going to take the object
parent and i'm going to scale it all the way up
until we can see it ah and one more thing
your cube also needs to be on the ui layer
like that let's scale it out to where i want it
remove it and if you can see this the the cube is being rendered here in
the background too and that's because our main camera
we need to remove ui from the coloring mask
okay and now that should actually be it it's gonna speed up the rotate
and there you go a 3d object on your canvas
so if you learned something give it a like maybe subscribe
i'm going to be making a lot of these quick tutorials so stay tuned
you