I'm getting really bad lag whenever I join my game private and public, but whenever I go to testing mode in studio there's no lag at all and it's totally smooth. I even started a server with 2 players in studio and no lag. It's only when I join in game, I could barely open performance stats since I was having such huge lag spikes.
I'm not sure but my best guess is I made a few (5) items with some special effects (just a few trails, sparkles and particle effects) and they are even in the server storage, but I don't see how this should make any difference, I didn't spam the effects or anything on the items.
Before I get the obvious answers, It's not my computer (obviously since it works perfect in studio, no lag at all even starting a server with TWO players) and it's not my internet since whenever I join the game everything goes laggy on my whole pc and then once I close it, everything's smooth and fast.
Do particle effects and sparkles and trails somehow create this lag?
However, there are many steps and precautions an aspiring developer can take to reduce the amount of lag generated in the Game.
Firstly to answer your question, everything that is in a game
will lag. And Particles
and Special Effects
, Textures
are no exception either.
Since you have said that the only assets you have is the Special Effects
, I will be cutting out all the other factors of lags and only focus on Particle Effects.
Special Effects
you are creating is being used locally
and not in a server
?If you are creating a special effect that takes a reasonable amount of memory and connection and putting it in a server
as opposed to local
, then chances are that that is the biggest reason as to why it is happening.
When you put it in a Server
the entire game will be forced to lag depending on the amount of rate and other major components of a Particles.
When you put everything in the Server
, it contributes to a lot of lag.
A good solutions could be by adding the effect to the Local Player
as opposed to putting it in the whole Server.
Distance the Camera is to the Particles.
This is a pretty obvious one I believe. But it still is the major significant issue. If you have a High-Detailed Particle
, chances are that when your Camera
is close to the particles, it will lag. Because Roblox tries to keep loading until it is successfully loaded, it will generate enormous lag.
If this is your problem then consider changing the Camera
property when the Particle Effect
takes place. Compromise a little details for Frames.
I then would suggest watching the video, Roblox Particle FPS Boost Script
and the model he created Particle Cutter
. Basically, the functions of the Particle Cutter
is to decrease the details of the particle when the Camera
is in a certain distance within the Particle
. The details are still lowered however they are not drastically dropped and ugly details.
There are always many reasons and they are not limited to the reasons I listed above. My premier solution would be to still look around and confirm that it is the Particles
that is generating lag and not anything else.
Tell me if it is anything else and I will update my answer. Till then, have fun debugging.