- Home /
Question by
Zack Brown · Jun 19, 2010 at 09:07 PM ·
buttoniphonetouch
Wrong Button touch?
I'm using the following code on a GUITexture called "Fire1":
function Update()
{
if (Input.GetButtonDown ("Fire1")) {
//DoSomething
}
}
Now my problem is it seems to "DoSomething" wherever on the screen I touch (Unity iPhone) does anyone have any idea why this is happening and how to solve it?
Comment
Answer by Tetrad · Jun 19, 2010 at 10:59 PM
http://answers.unity3d.com/questions/2807/simple-touch-command-on-iphone
Your code is actually saying "whenever the "fire1" button is down do something". If you're using GUITextures instead of UnityGUI, you'll have to manage the input yourself with raycasts and colliders and such.
Your answer
Follow this Question
Related Questions
Continuous shooting by holding iPhone button 2 Answers
iPhone Touch Screen? 2 Answers
Touch GUI texture to toogle animation 0 Answers
How can I swipe function that lets the player select buttons? 0 Answers