public void PistolAllowFire() { GameObject hero = GameObject.Find("Hero"); PlayerScript playerScript = hero.GetComponent <PlayerScript>(); playerScript.AllowFire(); }