Layers

Hi

can somebody tell me what layers are and how I can use them.

I read in the forum about it and I read there that you can choose which object is rendered by which camera.

How can I do this.

Can somebody tell me how I can do this?

What is the Tags Manager for.

I need really help there.

Here is how I have used layers so the camera only renders certain objects.

  1. Go to Edit → Project Settings → Tags (Note: you can get here also by selecting an object and on the Tag drop down or the Layer drop down, select “Add new tag” or “Add new layer” respectively.
  2. Next to one of the layers type in a name that identifies that layer. For example, I might use “Reflected” to use on objects that I am going to show a reflection of, of “HUD” for objects that I am going to use to create a HUD.
  3. Go to your camera and on the “Culling Mask” setting, select your named layer and unselect (so there is no check mark) the other layers.
  4. Go to the object you want rendered by that camera and select your named layer from the “Layer” dropdown.

The camera should now just render those objects with your named layer.

It always helps to see an example.

I am using layers to render a 3D globe map in my HUD. All my objects in the game world will have a child that is a billboard icon that will only render in my “map layer”. Then I have a camera rendering the globe graphics and object icons. It looks some thing like this. It’s very unfinished but you get the idea.

10205--371--$radar_175.jpg

Thanks for your great help. It works now. (Now I can start to create a good FPS)

But I have some questions.

First: How can I make that a object is available in two layers (i.g. map and player)

Second: How can I make that the mapcamera has got a transparent background (you can see the your picture of the playercamera or when you create a sphere like map because the viewport is a rect).

This thread may help…

http://forum.otee.dk/viewtopic.php?t=1486

Basically you need to change the “clear flag” of your camera to either “depth only” or “don’t clear” and make sure it renders second.

For making cameras only render certain objects you need to play around with the “culling mask” settings of the 2 cameras. Put all objects NOT to be rendered by one camera into a layer, and then choose to cull that layer in the camera’s settings.

Thanks a lot for your great help.