Hello! I have made an FPS Game, the only problem is, when I equip a certain weapon, the game just decides to lag, is it because of scripts or is it because of meshes?
Video demonstrating it, as you can see at the top, the whole game lags.
If someone knows what could cause this, please tell me, thanks!
have you checked how many triangles your mesh takes up? a few thousand should be okay. it is most likely the scripts that make up the gun. look out for loops that go through very large tables or client scripts that run remote events or functions often. if you are comfortable, could you maybe show us your code?
-task.Wait() - Changes the delay
-There should be no loops - It reduces the load on Roblox
-The number of events is limited - There are not too many events per minute
-Test on different pc
-Min. Animations per minute
I tried to list everything that came to my mind. Let me know if anything changes.
I did actually tone the models near 10k, it seems that my script is not made well, I don’t know why though, as I’m using task.wait() and coroutine wrap so it doesn’t affect the whole script when a function has a waiting period.
Could this just be a Roblox issue?