Lag spikes when shooting gun

Hello everyone,

I currently have a problem where when I shoot a gun in my game, There is a sharp spike of lag. The screen freezes up for a few seconds, and the microprofiler climbs. This didn’t use to happen, and I have not made any changes to the gun to cause this to happen.

  • The gun code doesn’t have any major issues
  • I swapped the gun out with multiple other models, and they all lag the same way
  • I have tried searching for scripts burning a lot of power but couldn’t find any
  • The gun does not cause any lag in other Roblox places
  • The lag occurs in both studio and the published version
  • I tried copying everything into a new place but the same lag still occurs
  • I disabled all other scripts but any gun still lags

Please help if you can,
Palmtreeninja2

2 Likes

Try checking console in-game and checking your game’s script usage.

Esc >> Settings >> Scroll Down >> Developer Console Open >> Scripts

Try looking for scripts that spike in activity % whenever you shoot your gun.

4 Likes