I am currently dynamically changing a layer of my weapon to 11 when I pick it up, which is NoClip. I have set up my cameras so that one only renders the weapon and the other renders everything else. The weapon rendering one is layered on top. This works as long as I have a gameObject set manually, without script, to the NoClip layer. But as I switch the layer by script, by the following line,
gameObject.layer = 11;
The layer DOES change if I pause the game and check the inspector for the weapon, but the camera does not seem to update and the weapon is still shown on the camera that cannot see the NoClip layer and not shown on the camera that is supposed to see the NoClip layer.