So I am making a digging game but have come into a little bit of a hurtle, Whenever you dig down to around a depth of 160 blocks (each block is 6 studs) you start to lag due to the number of blocks
You could try making a script to only show blocks within a radius of 60 studs to reduce the surrounding lag.
I don’t really know how that’ll work though.
Actually, I already tried that but still seems to have lag
I’m thinking its my rendering function
But I’m not sure how I could make my rendering function render faster with the increasing list of blocks because the way it renders is it goes through all the blocks and if its close to a player it will render if not it won’t be so I’m just not sure how to make it faster
As @SubtotalAnt8185 has mentioned, If possible, I suggest you attempt using StreamingEnabled.
You can find this in Workspace under Streaming, this is a good way to get around this issue if your scripts are not dependent on existing parts as it will only load in chunks for the player.
I am not fully familiar with this, but it will make your codes spread out across CPU cores. I am sure of it being a very efficient way of dealing with lag, but with instances, I am uncertain.
So currently im trying to implement a new system so that the block database does not exist anymore and all of the data is processed as is needs to be and is not constantly being run through.
If this does not work ill try what you said, Thanks
so what I did instead was got rid of the old system entirely and put a new system into only process the things that need to be instead of running through the entire table of existing and destroyed blocks every tick for every player