What I’m trying to do is get a value for how long the player has spent in the air, so I can later create a damage system based off of that. Right now, I have it so whenever a jump is detected, a while loop will start with a condition that the player is falling. While the player is falling I am constantly adding to that var “timeInAir”.
However, when I test this out I’m getting an infinite loop detected error.
I’m not sure why this is happening, since how I am thinking this would play out is the player would jump, the var would add until the player eventually hits the ground and the while loop is stopped. Maybe my approach of this is wrong? But I’m not sure. Any help would be appreciated. Thanks!