MultiTouch - Ball Launcher

I’m experiencing something fairly weird (though I don’t think it would break any actual builds) when the multitouch is setup on the game.

Basically if I test it on PC I get an error from the counsel where the touchPosition appears to be assigned infinity (out of view of screen) and the game immediately crashes. Testing on Unity Remote, however, there are no problems with inputs.

I am guessing this has something more to do with the input manager than anything else, but was wondering if anyone has experienced the same?

It’s a bug in the Device Simulator, sometimes giving touches that aren’t actually there. Try making this little change to the foreach(Touch touch in Touch.activeTouches) loop

        foreach(Touch touch in Touch.activeTouches)
        {
            if(new Rect(0,0,Screen.width, Screen.height).Contains(touch.screenPosition))
            touchPosition += touch.screenPosition;
        }
3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms