Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Enable/Disable Scripts

$
0
0
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); }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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