Hey folks, I’m trying to make a wall jump mechanic in 2D, so far I have the player clinging to the wall if I hold the directional button down, I want to press the jump button while I do that, and have it ignore the directional input and do the jump arc.
This is what I have so far:
void wallClingingFun()
{
rb2d.velocity = new Vector2(0, 0f);
wallCling = true;
doubleJump = true;
if (Input.GetButtonDown("Jump"))
{
wallCling = false;
if (facingRight)
{
facingRight = !facingRight;
rb2d.velocity = new Vector2(-25, 7);
wallJump = true;
}
else if (!facingRight)
{
facingRight = !facingRight;
rb2d.velocity = new Vector2(25, 7);
wallJump = true;
}
}
obviously, it’s not working, and I’m not sure what the correct functions I should use to make it work.
Any ideas?