I modified the PlayerWeapons script from FPS tutorial to pick up GUI Texture taps. This script worked perfectly fine, even after modification, and just stopped working:
var fireButton : GUITexture;
function Start () {
SelectWeapon(0);
}
function Update(){
for (var evt : Touch in Input.touches) {
var HitTest1 = fireButton.HitTest(evt.position);
if (evt.phase == TouchPhase.Began) {
if(HitTest1){
//do something when button is hit
BroadcastMessage("Fire");
Debug.Log("Shooting");
}
}
}
}
function SelectWeapon (index : int) {
for (var i=0;i<transform.childCount;i++) {
// Activate the selected weapon
if (i == index)
transform.GetChild(i).gameObject.SetActiveRecursively(true);
// Deactivate all other weapons
else
transform.GetChild(i).gameObject.SetActiveRecursively(false);
}
}