Input / iPhoneInput : Touch and confusion

Hello guys,

I’m trying to get the list of fingers on the iphone screen and then to manipulate this. I want to get the array of Touches and convert this to a builtin array (performances).

Java code, Unity3, dev on MBP.

var touchCount : int = Input.touchCount;
var touchesJS : Array = Input.touches;
var touches : Touch[];
touches = new Touch[touchCount];
touches = touchesJS.ToBuiltin(Touch);

I got this error in the editor :

Assets/Scripts/inputControl.js(67,38): BCE0022: Cannot convert 'System.Array' to 'UnityEngine.Touch[]'.

any idea ?

you help is much appreciated :wink:

thanks

You can just do

var touches = Input.touches;

No need to try converting to a dynamic array and back.

–Eric

Great ! thank you. I’m on that since hours… I can’t see anything else…
thanks you again.
Hervé