Hello, I’m trying making a game where the character has the ability to “dash” like Mega Man X (SNES), but I’m not succeeding.
May somebody help me?
Hello, I’m trying making a game where the character has the ability to “dash” like Mega Man X (SNES), but I’m not succeeding.
May somebody help me?
What exactly is going wrong? If it’s the scripting you’re having trouble with, have the character move faster on the push of a button with Input.GetButton. If you’re new to coding, I would suggest going through some tutorials and making a simple pong-like game before jumping straight into a full fledged game in Unity.
Thanks for the tip. To help, i’m writing the code below:
public void Moving(){
bool controlHorizontal = Input.GetKey(“left”);
float TimeOne = 0;
float TimeTwo = 0;
float moveHor = speed * Time.deltaTime;
float moveHorDash = speedDash * Time.deltaTime;
if(controlHorizontal != false){
state = walking;
pressButton = 1;
TimeOne = Time.time;
transform.Translate(moveHor,0,0);
if(TimeOne >= 2.0F){
pressButton = 2;
TimeTwo = Time.time;
float TimeDash = TempTwo - TempOne;
if(pressButton == 2 TimeDash <= 1.0F){
state = dash;
transform.Translate(movimentoHorDash,0,0);
Debug.Log(TempOne);
}
}else{
pressButton = 0;
TimeTwo = 0.0F;
}
}else{
state = stop;
pressButton = 0;
TimeOne = 0.0F;
Debug.Log(TempOne);
}
}