How efficient are coroutines?

Due to the limitation of Humanoid:MoveTo() yielding after 7 seconds for the past week ive been using a
Humanoid.MoveToFinished connection to loop my MoveTo()s to ensure the rig actually reaches the destination.

However ive found this can be quite hard to manipulate and play with if I wish the rigs to be maybe 1-2 studs away from the target.

So instead i’m considering replacing with a. repeat loop checking the magnitude to the target every second, however of course now id need to use coroutines else I could only run one rig per script at one time.

So I would like to ask, how efficient are coroutines, my use case would involve using around 100 of them, but id rather be able to run 200 as a stress test.

I’ve never ran 100-200 coroutine loops. But if they’re on the client (Which I’m assuming their not.) then I don’t believe any major issues other than client sided lag would arise.

However if you’re trying to use 200 coroutine loops (Or any loop for that matter) on the server, You’re going to lag your server really bad.

I would not recommend this at all.

I’ve at most used 2-3 coroutines & they work just fine, As I stated 100-200 seems far fetched.

Edit: When I stated “Any loop for matter”, I was implying 100-200 of any kind of loop.

1 Like