Need help with tool equip/unequip lag

I have a problem, which is tools creating lag depending on how many connected parts are inside.
I need to know if you can fix it, and how, without replacing the tools with versions that have less parts.

You may not be able to see the frame loss very well, but the spike on the microprofiler.
The frame loss doesn’t last forever, but for a set amount of time after equipping/unequipping the tool.

I weld the tools together in studio.
Parts in tools are connected with Motor6Ds if they are being animated, and are welded if they’re not being animated.

All parts in the tools have:
CanCollide = false
CanTouch = false
CanQuery = false
Massless = true

The tool being shown in the video has the most parts out of any tool, making it the laggiest.
Other tools have the same issue, but not as strong.

I use the default roblox tool equipping and unequipping system.

Some tools that are not equipped, are cloned and welded to a part of the character, so you know what they have. These tools appear and reappear when you unequip or equip the tool.

Unequipped = Tool can be seen on character
Equipped = Tool cannot be seen on character

This, however, makes the lag worse.
I’m doing all that on the client for all players. All i do is clone the tool, weld it back together as a model (using only welds), and weld it to a part on the character.


It still lags, without cloning the tools onto the character, albeit less.

I did find several posts talking about something similar, but i didn’t find a solution.
I hope this is fixable, because i don’t want to remove the tool models on the character or replace tool models.

1 Like

Try disabling all the scripts connected to your gun, does it fix the lag?

If so, the issue is in your scripts.

The duration of the lag did get reduced, but is still there and very noticeable. I disabled every script and the tool models on your character. The scripts being disabled didn’t help. Only the tool models not existing did.

If the issue is not caused by the tool scripts or the character’s layered clothing, and it is solely due to the number of parts, then the only solution is to reduce that number of parts.

Just wondering, how many parts does the tool contain? Also what are these part used for? All I see in the video is a mesh.

The tool in the video contains 19 parts in total. I forgot to mention that it wasn’t always like this. I don’t know what i did that is causing it, so i hope you guys can point me in the right direction. I don’t want the tools to be one simple mesh part, because i need to animate specific parts.

19 is not that much, are these real part or meshes that could have high tris count?

They’re all MeshParts that contain SurfaceAppearances with a ColorMap and NormalMap, with the handle being an exception. I don’t know anything about the tris count. It is a model, that i picked out of the toolbox.

I’m not sure if SurfaceAppearances could be causing the lag. You might try removing all of them to see if that reduces the lag. If it doesn’t help, the issue could be due to your meshes having a too high triangle count, which can be reduced in Blender using the decimate modifier.

Wouldn’t parts with a high triangle count passively cause frame loss? In my case you experience frame loss for a specific time period depending on the amount of parts, after which everything turns smooth again.

CollisionFidelity to Box would reduce some lag

maybe you are using a weld script that welds the tools on equipped?

It do both, having a large map with many high triangle count meshes passively reduces the frame rate, and spawning a set of high triangle count meshes in a visible and rendered area can cause an instant frame drops, especially when they are directly in front of the camera, as they are rendered at maximum quality.

That’s it. Changing CollisionFidelity helped. Thank you for suggesting that.
And no, i do not use a weld script. In the first post i mentioned, that i weld everything in studio.