Odd lag spike using TweenService to move parts on the client?

Edit: I’ve attached a local copy of the place, stripping down what’s unnecessary, including a large portion of the map. Following this, I did a test of the door again, this time with no lag whatsoever. A large portion of the map (if you can see in the background of the microprofiler screenshot) is made up of 4x1x4 mesh parts for the floor. Would this have anything to do with the lag?

Hello!

I have tried searching some similar issues, both online and here, but to no avail. Some posts claimed it was the server trying to replicate the movement to the client (not applicable, since it’s client-sided anyway), others claimed that it might be revolved around Roblox trying to perform collision calculations as the part is constantly moving (a lot I can image, since I’m using TweenService).

Based on the latter, I set the collision fidelity to box and disabled collision for the mesh part that acts as the door to see if I’d have any luck. Just to be safe, I disabled shadow casting on the part too. In brevity, a player opens a door by interacting with a keypad - a request is sent to the server, checking the player is in fact, within range of that keypad - if all is well, an event fires to all clients, telling that door to open.

Despite these few attempts to resolve the issue, I still get a really odd lag spike when the door is moving. It is of course using CFrame, and I was under the impression that Roblox wouldn’t have to solve for any collisions calculations, unless you were using Position? I’m at my wit’s end.

I apologise if this post isn’t elaborate. If you need any further information, I’m happy to oblige in giving it.


Here’s the microprofiler during the period at which the door moves (I’m still trying to familiarise myself with this).

Lag Spike.rbxl (99.1 KB)

1 Like

Okay, I’ve kind of mitigated the issue a little. I’ve changed most of the meshes (crates and railings) to have a collision fidelity of type box. Prior to this, I’d get a FPS of < 10, now it sits at about 30+.

1 Like