x


Apple touch device input touch question

I'm trying to use the following script along with the joystick.js script provided by Unity. This script disables the joystick by dominating all touches. Any help appreciated.

var guiSpeedElement : Transform;

private var normalizedSpeed : float = 0.2;
private var euler : Vector3 = Vector3.zero;



function Awake () {
multiTouchEnabled=true; 

guiSpeedElement.position = new Vector3 (0, normalizedSpeed, 0);
}

function Update () {

    if (Input.touchCount>0){
    for (var evt : Touch in Input.touches)

    {
        if (evt.phase == TouchPhase.Moved)
        {
            normalizedSpeed = evt.position.y / Screen.height;
            guiSpeedElement.position = new Vector3 (0, normalizedSpeed, 0);
        }
    }
}
}
more ▼

asked Oct 29 '10 at 03:46 PM

vertex gravatar image

vertex
105 13 13 15

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x951
x576
x118
x44

asked: Oct 29 '10 at 03:46 PM

Seen: 1310 times

Last Updated: Oct 29 '10 at 03:46 PM