Hello!
I have a general question in regards to reducing loop lag time. I have written a rather large code which controls anywhere form 30-60 customers in a tycoon game at once. This game relies on a while true do loop to calculate which action they should preform next. This code is the only loop in the game, but the output is less than optimal. The code works very well, but since each customer is moved by cframe to their next step, it seems to pause and skip a bit when lag is experienced. Any ideas on how to reduce the skipping portions? The loop is set to calculate about 10 times a second to ensure smooth, small movements since the humanoids are running walking animations during this time. Any advice would be appreciated.
Basic example code:
while true do wait(.1) Action = Calculate_Next_Action(Customer) if Action == 1 then Move(Customer) end end
