How to simultaneously move groups, and parts

I’m currently making a rhythm game, as a little passion project, but I’ve came across a problem

I need an efficient way to move a large amount of groups and parts. This is for moving the notes along the track.
Screen Shot 2020-08-17 at 7.40.45 AM

Is my setup right now. I’ve used SetPrimaryPartCFrame, but I’ve encountered many problems with collisions while using it, which is essential to see if the note has hit the ‘buttons’.

Using TweenService would be tedious, as you would need to make one for each ‘channel’, and Tweening so many parts once I start mapping large songs will cause lag.

Using

for i,v in pairs(game.Workspace.Notes:GetChildren())

would cause the notes not be moves in even, and instead have a slight delay between each notes movment.

If someone could point me to a good way to move both groups and parts at the same time, that would be very helpful :slight_smile:

(For people confused)

TweenService IMO wouldn’t be tedious. If you use Co routines and pass information via a list and the time of the track it should run smoothly.

1 Like

I’m sorry, but what are ‘Co routines’?

Wait, OH, You meant coroutine, right?

https://developer.roblox.com/en-us/api-reference/lua-docs/coroutine

It allows you to run a function several times at the same time, Yes.

You could also use “Spawn” functions however I personally haven’t used this before so I don’t know the PROS and CONS versus coroutines

1 Like

I’m unsure exactly regarding what you want to achieve, but you can use WorldRoot:BulkMoveTo to move several objects at once.

Spawn has a built in delay into it, so thats a con of using spawn, just FYI.