Var touch : iPhoneTouch = iPhoneInput.GetTouch(i);

For this line of code

var touch : iPhoneTouch = iPhoneInput.GetTouch(i);

I got this error message:

Assets/Scripts/Joystick.js(13,55): BCW0012: WARNING: ‘UnityEngine.iPhoneInput.GetTouch(int)’ is obsolete. GetTouch method is deprecated. Please use Input.GetTouch instead.

So I can see that iPhoneInput.GetTouch is obsolete, but I do not want to use Input.GetTouch… which is not iPhone touch if I understood it.

Anyway… I do not want to guess… where can I find all the methods and variables that are defined by the game engine ?

Maybe you have some documentation?

You want to use Input.GetTouch :wink:

Thanks :slight_smile:

Where can I find all the methods and variables that are defined by the game engine ?

If I change the code like this:

var touch : iPhoneTouch = Input.GetTouch(i);

I am getting:

Assets/Scripts/Joystick.js(13,57): BCE0022: Cannot convert ‘UnityEngine.Touch’ to ‘UnityEngine.iPhoneTouch’.

So I change it like this but I am guessing I have no idea … :

var touch : Touch = Input.GetTouch(i);

So now I do not have any errors but nither my iPhone respond to the touch… sdk 4.1

function update()
{
var count = Input.touchCount;
for (var i : int =0;i < count;i++)
{
var touch : Touch = Input.GetTouch(i);
if (gui.HitTest(touch.position))
{
gui.pixelInset.x = touch.position.x;
gui.pixelInset.y = touch.position.y;
}
}
}

Check your install directory.

hello. I getting the same error as you eran.gross . How did you menage to solve this problem?

In U3 its no longer iPhoneTouch its just Touch (as any input no longer is in iphoneinput but Input)

gettouch is an obsolete function only present for backward compatibility with obsolete code, you normally would use Input.touches to get touch i

In Unity under Help/Script Reference or in your install directory/Documentation/welcome.html