I’m making a system where two players can chain together, it works perfectly, except the first person to joint the game lags a ton, im using a chain made of meshparts and ballsocketconstraints, and alignposition to align it to the player, but only the first player lags. The second player runs great.
I don’t know why this is happening, and I’ve tried tons of things.
A lot of constraints lags pretty badly, especially connected with meshes, try to optimize meshes by reducing their collisions and remove unnecesary propertiess like shadows or querries, then try to replace coinstraints with custom made script that simulates physics, use client side to render meshes too, you don’t need them on server
yea, but creating parts and joining them can cause one time lag, i used to have that with tools with one server script inside them, i used alternative ways to fix it by doing framworks…
in this case you should add maybe task.wait() in loop that creates this chain? it will make server create it more gently and overall, prevent lag spikes
The lag isn’t temporary, it stays for the first person to join the game, which makes no sense, since it’s not network ownership, because i’ve tried having the server handle it, and I’m not constantly making new chains.
This also happens if you rope two players together to eachother, because one takes ownership over the rope (Part0).
Fixing this you will have to make a prediction-like system (which roblox already has) to predict where the player is going and then smooth it out on the server and let the client know what they are doing is right. I rather suggest having the chain not directly attached to the players, but instead “welded” by constantly teleporting them on the clients/servers of the players. Then just limiting how the players can move.
Also you can choose to ignore what I said and do research on the devforums about roping 2 players together without lag. There is probably someone out there who has already solved this problemd.