- Home /
Problem with iPhoneInput.touchCount
My problem is with iPhoneInput.touchCount . I seem to be getting a touchCount of 1 even when i dont touch the iphone screen. Any ideas?
Sorry i posted a remark as an answer !
No, the problem persists even when i use Input.touchCount. Here is my code:
noOfTouches=Input.touchCount;
if(noOfTouches== 1)
{
var currentTouch:iPhoneTouch = iPhoneInput.touches[0];
if (navigationUp.guiTexture.HitTest(currentTouch.position))
{
xinp=1;
}
etc...
You need to give a little bit more information as to what your problem is -- I don't think Input.touchCount would be returning 1 when nothing is touching. What is happening that makes you think it's returning 1? Is it because it's getting inside of that block of code? Where is this code being executed? In the Update() function?
If you want to be doubly sure, right above where you define noOfTouches, put:
Debug.Log(Input.touchCount);
And see what gets spammed in your console.
zapdot you were absolutely right. It was absolutely my fault. Thx!
Answer by starman · Sep 15, 2011 at 07:32 PM
The same thing happens when i use Input.touchCount
Here is my code:
noOfTouches=Input.touchCount;//jss
if(noOfTouches== 1)
{
var currentTouch:iPhoneTouch = iPhoneInput.touches[0];
if(1==1) //currentTouch.phase == iPhoneTouchPhase.Stationary || currentTouch.phase == iPhoneTouchPhase.Began)
{
if (navigationUp.guiTexture.HitTest(currentTouch.position))
{
xinp=1;
}
etc..
Your answer
Follow this Question
Related Questions
iOS touches buffer 0 Answers
check touch position 2 Answers
What is the difference between iPhoneInput & Input ?? 1 Answer
How to prevent touch to propagate through new UI Button? 1 Answer
Input.touchCount returning wrong number 0 Answers