help with multitouch buttons
English:
Hello everyone, I'm starting in unity and I ran into a problem that I can't find a solution for,
I'm trying to make a retro-style game, like it's a gameboy emulator, but I'm having trouble getting buttons to run at the same time ... ... if I run it won't let me jump, if I attack it won't let me run.
Any idea how to fix it?
what I have done is set variables to move the character and set void for each of the actions I leave part of the code
Beforehand thank you very much.
Español:
Hola a todos, estoy empezando en unity y me tope con un problema que no le encuentro solución,
estoy tratando de hacer un juego estilo retro, como si fuera emulador de gameboy, pero tengo problemas para hacer que los botones se ejecuten al mismo tiempo... ...si corro no me deja saltar, si ataco no me deja correr.
¿Alguna idea de como solucionarlo?
lo que he hecho es establecer variables para mover al personaje y establecer void para cada una de las acciones dejo parte del codigo
De antemano muchas gracias.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
...
public float Velocidad;
public float VelocidadRotate;
private bool arriba = false;
private bool enfrente = false;
void Update(){
if (enfrente){this.transform.Translate(Vector3.forward * Time.deltaTime * Velocidad);}
if (atras){this.transform.Translate(Vector3.back * Time.deltaTime * Velocidad);}
if (girDerecha){this.transform.Rotate(0,VelocidadRotate*Time.deltaTime,0);}
if (girIzquierda){this.transform.Rotate(0,-VelocidadRotate*Time.deltaTime,0);}
...
public void MoverEnfrente(){enfrente = true;}
public void MoverAtras(){atras = true;}
public void Detener(){enfrente = false;atras = false;arriba = false;}
...
Almost all the actions I wrote them like this
on the canvas I use Event trigger pointer Down, up enter and exit to add the functions
Casi todas las acciones las escribí así
en el Canvas uso Event trigger pointer Down, up enter y exit para agregar las funciones
Your answer
Follow this Question
Related Questions
Moving and jumping 1 Answer
Delayed jump on android 1 Answer
Event Triggers or onClick For Mobile 0 Answers
How do I control my car with UI buttons? 0 Answers
Canvas render dynamic mesh dissapears on mobile build 0 Answers