hi there,i just want to render a animated model/mesh before any other 3d content(like a 2D layer,as guitexture do) in unity,i found some funtions to drawMesh,but if i use drawMesh i can’t play the model’s animation(just draw a static model),what should i do?is there any functions to set gameObject to show on the top layer or something??
thanks for answers!
anyone helps?
When you say “render before” do you simply mean you want it rendered on top of all other objects? Or do you really need it rendered first, before anything else gets rendered? I ask as you say “before” which implies it’s first in line to get rendered before everything else, but then you reference “like a 2D layer, as guitexture do” and that made me think you were looking to render this one model (or some models) on top of/in front of everything else.
If you want to render it in front of everything else then:
-
Use multiple cameras
-
One camera will have a lower depth setting and render everything in your scene but this one model.
-
A second camera will have a higher depth setting and render only this one model, thus drawing it (and only it) on top of all other elements.
For more information check out the Camera component. In particular note the clear flags, depth and culling mask options. Give that a read and post up if you have any other questions and we’ll go from there!
sorry i did’t make my self clear, i mean “on top of”
,i will try what you say,thanks