so basically i want to run a loop instantly over and over.
For example:
A While loop needs a task.wait, and even with the smallest amount of time put in it the loop still takes a few milliseconds to continue onto the next loop
But For loops do it instantly, it doesnt need a wait either.
Is there a normal loop i can make that runs for a specifided amount of loops like 100 times or 1000 times and does not wait at all?
The reason im trying to do this is because i need my game to make thousands of small calculations within the smallest amount of time possible, and while loops just arent fast enough
dude that’s not possible at all, a while loop will happen as long as a condition is true so if you don’t have a yield it’s running too fast and you’ll get the error I showed up there, a for loop on the other hand has an end so you don’t need to yield although for more computational expensive stuff it’ll have to work harder
How is it not possible with while loops but possible with for lops? To make the while loop not yield, just don’t put a task.wait in the body or condition.
All you have to do with the while loop to avoid an execution timeout is put an exit condition somewhere.