Question by
thiagolavor · May 03, 2017 at 02:31 AM ·
movementinputpositiontouch
Mobile touch
Hello, how are you ? I'm working on mobile game and need some help to transform this code into touch, the game is in 2d
if (Input.GetKeyUp (KeyCode.RightArrow)){ timer += Time.deltaTime; if (timer > velocidade) { transform.position += new Vector3 (1, 0, 0); timer = 0;
}
if (Input.GetKeyUp (KeyCode.LeftArrow)){
if (timer > velocidade) {
transform.position += new Vector3 (-1, 0, 0);
timer = 0;
}
if (Input.GetKeyUp (KeyCode.DownArrow)) { timer += Time.deltaTime; if (timer > velocidade) { transform.position += new Vector3 (0, -1, 0); timer = 0; }
The object goes down to the left and right side From this I thank you for your help.
Comment
Your answer
Follow this Question
Related Questions
Touch Controls without virtual joystick 0 Answers
Touch position returns weird behaviours 1 Answer
Android| Camera scrolling 1 Answer
difficulty in detecting multi touch 1 Answer