Ok, thank you! I am trying this out right now. I do not think it is only my PC, others have been saying it is freezing.
This seems to be worse then before.
If thatās the case then your lag is purely originating from your PC, which means that you cannot fix it.
Either that or you have to change WAIT_TIME
to something larger than 0.25. Thatās what youāll have to settle for if you want a simple disco floor.
324 unanchored parts, changing colors every 1/30 second ā 60 fps
Thereās something wrong with your computer.
I think you mean his computer.
Can I give you the game link then you see if it is lagging from your computer.
Yes I meant him but I forgot.
@henberrysodapop
Iāve played this game yesterday, you must know that your game has thousands of parts and thereās no way a simple script which changes a color every quarter of a second will break your game.
I played on mobile and it was running smooth. Just when I showed someone it they said that is was freezing up for them and their PC usually runs smoothly.
What is a memory leak? I have heard it before just never actually looked up what it is.
If thereās lag in your game then the code you posted definitely isnāt causing it.
Whenever I remove the code my game runs smoothly again, I think it is that.
The while loop is not running fast enough to slow down the game. And you said the inner loop is only running around 20 iterations. There has to be something else. Is what you showed the entire script?
This is being annoying because my game has so so many parts and lags by this script, with no memory leaks form the looks of it.
Yes, that is the whole color changing part which is making the game freeze.
I tried changing one parts color every five seconds and it still lags, I do not think this is my fault anymore.
I donāt think your disco floor is the problem behind the lag. You may have other scripts running in the background causing it.
Instead of putting the Colors in the functions why not just put it where you put the color variables.