What do you want to achieve? I want to stop my game from having lag spikes, it is a tycoon game.
What is the issue? The lag spikes affect me on a laptop so it would be very hard on moblie players and so far there are only a few droppers out of many.
What solutions have you tried so far? I was thinking about adding a setting to remove textures but other than that I want to know how to reduce these spikes.
Here’s a video of it down below:
I’m hoping that there’s a way to fix this other than adding a whole bunch of settings options because that wouldn’t be too effective…
Edit: This game contains 0 blender assets and everything was made in roblox studio.
There is probably some kind of memory leak in your code somewhere, I can’t say much other than to simply try searching for problems in your code, maybe in the code for spawning the parts?
Disable cast shadows for all the parts created from the droppers.
If you want to go further, disable CanTouch, and disable CanQuery. If you can, anchor the parts that aren’t moving on the conveyor to reduce physics calculations.
I’m a scripter, and one time I was doing simple models that included small parts. I try testing and the default loading screen took 20 seconds and I only had less than 30 fps. Once I turned cast shadow off, things got better.
The game is a classic-style game with studs, and for some reason the reSurface tool AND building tools by f3x are unable to texture unions into studs I was thinking about unioning the parts but if I did that it would generally ruin the style of the game…
try disable touch convenyour also add another collisiongroup as “Cube” it’s should be not being impact each other cube if you turn off collisiongroup again cube only
There are still some lag spikes but it’s much better than last time, last time it was so laggy I had to not only force quit roblox studio but restart my computer (It’s a laptop). Now, I can normally leave the game and it takes a sec or two but none of that quit application stuff
Maybe you’re doing Instance.new() like 15 parts in a second.
Maybe you can queue some of those stud like parts in ReplicatedStorage. And then just parten them to workspace or in the right location and position. That way, you can split and spread out the part-creation workload.
Good catch, @Pish85 try to combine some scripts too. While it is easy to do, having too many scripts will cause lag. Try to only use 1 script to control the simulator system instead of 1 script per item in your simulator.
OH YEAH I JUST REMEMBERED: So basically each dropper has a script. There’s a plot called template plot. When you buy the button it clones the item from template plot to your plot and loops through the descendants and enables all scripts. Scripts in template plot are naturally disabled. If I had 1 script for every dropper I would have to mess around with properties and attributes and whatnot which could easily mess up my entire script
A way to fix the lag spikes that seem to be coming from the droppers is surely to disable the cast shadows from the parts that are spawned from the blocks.
Seems like you’re making a tycoon, instead of spawning many blocks with each different small amount, it’s better to merge them and spawn fewer parts but with a higher value.
I know it might be less visually appealing but it might improve the lag.
Checking for scripts that might cause this lag is also a solution.
First method ( simple way )
Try this only single loop
you only need add IntValue to Dropper as delay and delaystart
also you can right? like a Parent dropper to new folder called “Dropper_loop”
while wait(1)do
for i,v in pairs(workspace.Dropper_loop:getChildren()) do
v.delay.Value=-1 -- keep dept per second
if v.delay.Value==0 then -- once delay reach 0
v.delay.Value=v.delaystart -- let just say edit this as 5 soo it mean it take 5 sec to able spawn then return to 5 sec again to be wait
print('add here to spawn stuff')
end
end
end