Task.spawn() / coroutine.wrap(function() for bullets is it efficient?

making new threads for each bullet might be a bit stressfull to the client should i just have a table of all projectiles and update them each simultaneously or should i just create a new thread for each bullet.

2 Likes

update each simultaneously, creating a new task for each bullet is the same thing

I’d go with the method that is easiest to implement and tinker with. You can optimize if you run into performance issues. The options will make more sense when you have more information about the problem.

1 Like

From what i’ve experimented with its not, when i had server sided objects with seperate threads for updates the server lagged tremendously compared to updating each one one by one

1 Like

Creating a new thread significantly increases the throughput and will cause lag because the data rate is much higher.