I’m creating something in which players can use weapons built using meshparts and unions, but no matter how much I lower the part count/polygon count, there is always minor lag when the weapon collides with a large object. I’ve tried placing the part in a separate collision group that is unable to collide with anything, but this doesn’t fix the issue. Is there a possible way to make it so the weapon’s parts are just not affected by physics at all? That way even when they collide with something, the physics engine just plain ignores it?
There’s no way to completely disable collision checking for parts. Setting CanCollide to false will allow the part to skip past the calculations of reactionary force, but that’s going to be negligible assuming it’s enough to even measure a change at all.
Collision checking has to happen for all parts due to the Touched/TouchEnded events, so there’s no provision for removing a part from the batch that’s collision checked.
I’ve never once encountered any latency related to collisions, so I’m suspecting something else may be the root cause. What kind of numbers are you seeing on average during the lag for the Contacts value of the diagnostics menu? (Alt + F1, or Ctrl + F1, or Shift + F1 to open a diagnostics viewport gui in game and studio, or View > Diagnostics to open up the studio gui widget)
It stays around 50-90, but when I’m near a player with a weapon on their back, it jumps to around 800-1000.
When the lag happens though, the contacts value doesn’t change much. So it isn’t collisions then? The lag only happens during certain collisions, yet the contacts values barely changes during the laggy collisions. I am confused.
I suspect you already tried this, but I want to make sure: you made the collision boxes all square for the meshes/unions, correct?
About how many parts comprise a weapon?
around 4-7 meshparts
Okay I removed all weapons and I’m still getting some lag… dangit. It still only happens during collisions, but it has nothing to do with weapons so that’s good.
I’m now completely lost as to what is causing lag. My game lagged so badly that I had to close the roblox window to exit the game and rejoin JUST because I managed to glitch myself into a wall.
dont use free models and try making a single mesh for the weapon. Blender is easy to learn and it will help you to make a single gun mesh textured