Hey guys. I know this question has been asked a billion times, but I can't seem to find the info I need. I'm trying to make a script where when the Player clicks a flashlight, the flashlight activates the flashlight script attached to the player while the model that the Player clicks destroys itself. While the model is destroyed, the script doesn't activate. Any help?
var Flashlight : Flashlight;
function Start() {
Flashlight = GetComponent();
}
function OnMouseDown() {
Flashlight.enabled = true;
Destroy(gameObject);
}
↧