Quantcast
Channel: Questions in topic: "css"
Viewing all articles
Browse latest Browse all 78

Disable item after 10 shots.

$
0
0
Hello how can I disable an object after you press 10 times the left-muose? This is the script that I'm using, but does not work very well. My script. #pragma strict var myTrigger : GameObject; var myObject : GameObject; var countAmmo : int = 10 ; function Start() { } function Update() { if(Input.GetButtonDown("Fire1")) countAmmo = 10; //myObject.SetActive(true); countAmmo = (countAmmo -1); countAmmo = 0; myObject.SetActive(false); }

Viewing all articles
Browse latest Browse all 78

Trending Articles



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