HEY! I just wanted to ask if there is a way to have scripts enable components on other objects. Maybe you have a timer, and when it reaches some point, it enables something like another script, or maybe a light source, or checks a mesh render on another object (or the same). That sort of thing. In javascript please ^^
Just use the .enabled property (if it exists for that component). GetComponent(Blah).enabled = true.
just get the component from the gameObject and then set “.enabled” to true or false.
on some kind of trigger event it could be like this:
var component : nameOfComponent = collision.GetComponent( nameOfComponent );
component.enabled = true;
//assuming default is false
or if no collision/trigger event…find the gameObject first…and get component from that.
var gObjectComponent : nameOfComponent;
gObjectComponent = GameObject.Find("nameOfGameObjectWithComponent").GetComponent( nameOfComponent );
if( time >= 3seconds )
gObjectComponent.enabled = true;
else
gObjectComponent.enabled = false;