Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

GameObject won't turn back on

$
0
0
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?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>