Is there any while loops, or something similar, so i can do certain things while in a specific state? For example for the wall jump i want to say
//
while(touching wall)
{
Pause for a second then drift slowly down
}
otherwise gravity is normal
//
But anything I try the character will drift slowly down after touching the wall then moving to the side and not actually being on the wall.
Second question. If i want him to jump off the wall, if there a better way then changing the horizontal velocity? I only want him to move about 5-10 ‘units’ away from the way then hold normal horizontal velocity.
@jlimbach i just used an if statement…` if (CheckIfOnWallToRight() == true)
{
// make you jump of the wall
if ((Input.GetButtonDown(“Jump”)) && (Input.GetButton(“d”)))
{
playerController.GetComponent().enabled = false;
rb.velocity = new Vector2(-5, 10);
wallJumpedFromRight = true;
}
// makes you wall slide
else if ((Input.GetKey(“d”)) && (wallJumpedFromRight == false))
{
rb.velocity = new Vector2(0, -1);
Debug.Log(wallJumpedFromRight);
}
}
if (wallJumpedFromRight == true)
{
iR += 1;
}
if (iR >= 25)
{
iR = 0;
wallJumpedFromRight = false;
playerController.GetComponent<PlayerMovement>().enabled = true;
}`