Game Development Reference
In-Depth Information
Figure 6-9. Creating a weapon camera layer to restrict camera rendering to weapon objects
After creating the layer, assign all Weapons objects to it. This can be achieved in just one cascaded
operation, by selecting the root Weapons object, beneath the Player object, and assigning it to the
weapon_layer, allowing the assignment to be applied to all child objects downward in the hierarchy
(see Figure 6-10 ).
Figure 6-10. Assigning Weapon objects to a render layer
Finally, the WeaponCamera can be configured to render only from the weapon_layer, through the
CullingMask member. Select CullingMask from the Object Inspector, picking only the weapon_layer
from the drop-down (see Figure 6-11 ). Once selected, this restricts rendering to only the selected layer.
 
Search WWH ::




Custom Search