i have this script
#pragma strict
var target : Transform;
function Start ()
{
}
function Update ()
{
if(Physics.Linecast(transform.position, target.position))
{
gameObject.SetActive(false);
}
if(!Physics.Linecast(transform.position, target.position))
{
gameObject.SetActive(true);
}
transform.LookAt(target);
}
it’s attached to a directional light which is the child of a local star, siblings to other objects such as particle systems and a point light, and the target is the u.s.s. voyager. when the ship goes around the planet, the light deactivates, giving the illusion of the sun being occluded by the planet, but it won’t turn back on after voyager emerges from the other side of the planet. any ideas?