I am trying to have a variable go up when you walk and then go back down when you stop, as a way to monitor how loud you are, however i don’t just want to do a “Set variable to” because then the variable will snap from 0 to 2 in an instant and i want it to go up one step at a time. I did this through a while loop that first checks if you are moving to the right (i will do left later in a similar script) then checks for if you’re not jumping or crouching because those will have louder volymes. If all that is true it adds +1 to a variable every 0.2 secounds and stops once you hit 2. the thing is that when i preview the game it freezes the instant i press right, i’ve considered that it might be checking something rapidly over and over forever which could be hard on the computor. But really the max amount of times that this loop will ever play is two because the variable keeps going up by one until it hits two and the loop even has a 0.2 secound wait inside it so the loop wouldn’t even play that fast if it did repeat forever! Here’s my code:
Please help!