|
This is my first post and I need help with getting a ammo count that will decrease every time a bullet is fired. I would aslo like to get a reload function that would sutract from a clipsLeft var and reset the ammo var. this is what I have so far. `var projectile : Transform; var shootSpawn : Transform; var ammo : int = 6; var clipsLeft : int = 10; function Update () { if (Input.GetButtonDown("Fire1")){ if (Ammo > 0){ clone = Instantiate(projectile, shootSpawn.position, shootSpawn.rotation); Physics.IgnoreCollision(clone.collider, collider); //This is the subtraction function that I'm having trouble with. ammo -= 1; } else { print("Reload"); } } }` If anyone could answer using Java Script it would be much appreciated!!!
(comments are locked)
|
|
Does this do what you're looking for? For the most part yes! thank you!
Nov 14 '10 at 02:19 PM
pdh1kid
(comments are locked)
|
