Hello there!
I have some objects that I want to appear them on the screen but don’t want them to be affected by the main camera.
The whole purpose is that, it will appear some models on the side of the screen, and the player will drag them to plot on an another object.
first I would use the image of my models as gui textures, but I want them in 3d, beacuase i’ll rotate them around themselves untill the user grabs it.
What might be a solution to this?
I resolved this issue with the help of hijinxbassist, so i’ll explain for others who search for this problem.
here’s the steps:
- click on the prefab that you want to appear on the top of everything else
- go to the inspector and add a layer and call it “topLayer” or anything you wish
- set the layer of your prefab to “topLayer” or the one you added.
- create an another camera and in the inspector
. set the ‘Clear flags’ to depth only
. open the ‘Culling Mask’ drop down and tick besides the “topLayer”
. set the depth to 1 since the main camera has a depth of 0 - just above the depth, set the position and size of the camera that you want it to appear on the top of the main camera view.
- If your prefab appears also from the main camera, you can simply change the culling mask of the main camera by deselecting the layer you want to appear.