- Home /
Putting an image in the middle of two cameras (not repeated)
Hi,
My game screen is split in half, camera on the right and one on the left. I want to put an image on top of the middle area between them (i.e. I want the left half of the image appearing on top of the of the left camera and the other half on the left part of the right camera.)
Kindly find a screen shot I made with my desired requirements.
Thanks
Answer by taxvi · Dec 15, 2014 at 11:38 AM
lol but you need the third camera to draw above everything:
create an empty object with the GUI texture you need
put that object into a separate layer
create a new camera and give it the following settings:
Clear Flags: Depth Only
Depth: anything bigger than both left and right cameras' depth (max 100)
Culling Mask: the layer of your new GUI object
I think people naturally think a camera is "expensive" because a real-world camera is. But it's just settings. Anyway you do this, the math is the same in the end.
And if you already know how to add a 2nd camera, why not go that same route and add a third?
good point, I just tend to keep in $$anonymous$$d the number of drawcalls but yea, in this case its negligible
Answer by HarshadK · Dec 15, 2014 at 11:40 AM
You can use new UI (Unity 4.6) to achieve this effect.
Create a canvas with Render Mode as 'Screen Space - Overlay'.
Add an image to this canvas and position it on the center of the screen.