C#C
C#3y ago
TheFatMike

❔ while statements

Hello im stuck on a small part of my code im trying to use a while statement but its crashing the game. I dont want multi jumps to go < 0 is there a way to do that with the "multiJump--;"?

if (gI.jumpInput == true)
{
while (multiJump > 0)
{
if (grounded)
{
rb.velocity = new Vector2(gI.valueX * speed, jumpForce);
multiJump--;
}
}
}
gI.jumpInput = false;
multiJump = 1;
Was this page helpful?