Hi - I have a light which I only want to be seen by one camera, but as culling masks don’t work, I thought I’d set this light to active when the player sets the camera to active.
But I can’t work out why this script doesn’t work - I can see the correct camera is active in the hierarchy, but although no errors are thrown - the light isn’t set to active.
Any ideas why?
public var cameraC4N :GameObject;
var spotLight : GameObject;
function Start () {
spotLight.active = false;
}
function Update () {
if(cameraC4N.activeInHierarchy == true)
{
spotLight.active = true;
}
}
All the best, Laurien