- Home /
Question by
Huruffus · Jan 01, 2013 at 11:37 PM ·
buttonmultitouchtouchpad
Making multitouch button
Hello! I try to making a multitouch button "jump". At this moment I had written the touching on button immediately (touching only this button).
Now i want to writing the touching to this button with other buttons. For example: touch moving joystick and touch button "jump". Can you help me with it?
Script:
void Update () {
int count = Input.touchCount;
if( count == 1 )
{
Touch touch = Input.GetTouch(0);
// Touch only jump button
if ( jumpButton.HitTest( touch.position ) )
{
characterSphere.upForce();
}
// trying to writing: to touch jump button and other button
else if ( !jumpButton.HitTest( touch.position ) || touch.phase != TouchPhase.Began )
{
characterSphere.upForce();
}
}
}
I take this code (program) in Penelop iPhone tutorial.
Please sorry if my English is poor.
Could you say me my mistakes in language?
Comment