- Home /
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);
}
}
} }
Comment
Your answer
Follow this Question
Related Questions
Question about user input event handling in Unity game for iOS 2 Answers
Joypad help 0 Answers
Erratic mouse Input.GetAxis values on OS X 0 Answers
Detect the direction of a swipe? Touch screen input. 3 Answers
Camera movement using touch input 0 Answers