Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

I can't get my script to have a timer that runs down

$
0
0
What my script is supposed to do is have my "Matchbox" hit the "FirePit" and turn it on. When my "Matchbox" hits the "Firepit" it does turn it on but it would stay on forever. So I tried to add a timer to my script to run down when the "Firepit" got turned on and would eventually turn off. I keep getting this error under flame.SetActive = false; (9,7) Expression 'self.flame.SetActive' cannot be assigned to. #pragma strict var myTimer : float = 5.0; var flame : GameObject; function Start () { flame.SetActive = false; } function OnTriggerEnter (Col : Collider) { if(Col.tag == "Matches") { flame.SetActive = true; } } function Update () { if(flame.SetActive == false) { myTimer -= Time.deltaTime; } if(myTimer <= 0){ flame.SetActive = false; } } Thanks in advance if you decide to help me! :)

Viewing all articles
Browse latest Browse all 7934

Latest Images

Trending Articles



Latest Images

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