I’ve one button to aim down sights, and one to shoot… oh and this is a android project
when I click on the shoot button, it works, however when I hold down the aim down sights button, the shoot button doesn’t work what is wrong with my scripts??
this is attatched to the shoot button:
function Update () {
if (Input.touchCount == 1){
var touch: Touch = Input.touches[0];
if(touch.phase == TouchPhase.Began && guiTexture.HitTest(touch.position)){
print(“worked”);
GameObject.Find(“M40A11”).SendMessage(“shoot”);
}
}
}
and this is attatched to the aimDownSights button:
if (iPhoneInput.touchCount ==1){
var currentTouch:iPhoneTouch = iPhoneInput.touches[0];
if(currentTouch.phase == iPhoneTouchPhase.Began && guiTexture.HitTest(currentTouch.position)){
isAiming = true;
}
if(currentTouch.phase == iPhoneTouchPhase.Ended){
isAiming = false;
scopeTexture.gameObject.active = false;
cameraa.camera.cullingMask = mask;
}
}
thats not the whole script because it’s long.
Please reply!