I’m developing a game for Android. I have created various Textures (not GUITextures!) to use as buttons and i’ve placed them at relative positions on the screen so they can be moved and resized according to screen resolution. Now i need to code this: when the user touches a specific area of the screen (where one of these textures is, but this is not important) something happens. I tried to use HitTest but Unity keeps giving me the error "an istance of type ‘UnityEngine.GuiElement’ is required to access non static member ‘HitTest’ ". Is there a way i can use HitTest just to check if an area of the screen has been touched without using GuiTextures?
This is the code i’ve used (well, it’s copied from unity scripting reference)
function Update () {
if(guiText.HitTest(Vector3(100,100,0))){
//something happens
}
}