hello all im having trouble making my amo hud work all i want to do is make a script that enters another script and find the amo and simply just say the amount like a hud but with numbers and no textures
this is my shooting script
var prefabBullit:Transform;
var shootforce:float; var otherClip : AudioClip; var ReloadTime = 5.0;
static var Amo = 10;
function Update () { if(Amo <= 10) { if(Input.GetButtonDown("Fire1")) { var instanceBullet = Instantiate(prefabBullit, transform.position, Quaternion.identity); instanceBullet.rigidbody.AddForce(transform.forward * shootforce);
//Audio
audio.clip = otherClip;
audio.Play();
//Amo
Amo -= 1;
}
}</p>
if(Amo == 0)
{
Reload();
}
Debug.Log (Amo);
}
function Reload() { yield WaitForSeconds (ReloadTime);
if(Amo <= 0){ Amo = 10; }
and my amo
function OnGUI ()
{ guiText.text = (shoot.Amo); }
thanks :)