Most efficient way to move/tween 400~ parts?

Me and my mate Gidein have recently started a project with a bunch(457) parts that require either to be Tweened to a specific location or Rotated X amount of degrees.

However, after about 370 parts we noticed a considerable amount of lag.
We’re currently using a system that detects movable parts in a 150*150 stud radius and only moves those, the rest gets paused and only gets un-paused whenever the player gets in the hardcoded stud radius.

The question at hand would be if there is any method of doing this with a considerable lag decrease while also maintaining the core functionality of the before mentioned script.

Are you trying to move all of these parts at the same time? If so, you could turn them into a model, and choose a primary part. Then use :SetPrimaryPartCFrame to move the entire model. Not sure if you can use tweening with it however.

If you’re moving/tweening anything alot in repeated frames on the server, that is your issue. Do not do effects/heavy movement/fast updates on the Server, they should be done on the client. If you want to verify the position on the server every once in a while, it is fine to update it every 2 seconds or so. Updating it every milisecond is a terrible idea in itself.

You can probably fix this by having remote events send an event when it moves, then do the tweening effects on the client as usual.

Important things like detection, sanity checks, and stud radius of course should be done on the server as per usual.

Although this solution did not ultimately solve my issue, it is inevitably the cause of the issue. I have found another solution to my problem which involved some number crunching.

Thanks for the detailed description. <3

1 Like