Hi Everyone,
I’m trying to figure out what I’m doing wrong. I want to expand the a GUITexture.HitTest area so it’s easier to touch because the button is small (so it doesn’t clutter up the screen space), has anyone else figured this out?
var buttonB : GUITexture;
function OnGUI(){
buttonB.transform.position = Vector3 (0,0,-1);
buttonB.transform.localScale =Vector3 (0,0,0);
buttonB.pixelInset = Rect (0,Screen.height - buttonB.pixelInset.height - 6, buttonB.pixelInset.width,buttonB.pixelInset.height);
}
function Update (){
for(var touch : Touch in Input.touches)
{
if(touch.phase == TouchPhase.Began && buttonB.HitTest(Vector3(Screen.width - buttonB.pixelInset.width,Screen.height - buttonB.pixelInset.height,0)))
{
Debug.Log("The News");
}
}
}
I just want to point out that touch.position works fine but again the touch area isn’t big enough…HELP PLEASE!
P.S
This is for mobile so it needs a HitTest.