#Need help with Huge lag cz of Parts

1 messages · Page 1 of 1 (latest)

true river
#

Hello!
I have been creating a game without scripts and with physics only, but recently the machines started to break cz of the ammount of moving parts, is there anything i could do?

Was thinking about a script which makes you only see the parts in a 20-30 studs range.

cunning heath
cunning heath
true river
cunning heath
true river
cunning heath
true river
#

i jst dont know how

#

no idea if this helps

cunning heath
#

Oh. With HingeConstraints

true river
#

yeah

#

and there is too much of it

#

and ropes too

cunning heath
#

Does it need to be physic based like that tho? Because if not you could just use an animation. That would probably reduce the lag a lot

true river
#

I would like to keep it like that since i cant animate or script

#

i tried to write a script where the parts dissappear if they are 20 studs away

#

but the faces and the moving parts didnt dissapear

#
  • the whole terrain was gone
#

and i believe the game still processed the parts cz some of the machines was broken

terse hollyBOT
#

studio** You are now Level 1! **studio

cunning heath
#

well. I am pretty sure that even if you make them dissappear that won't make the lag go away. You should try simulating more things on the client but that requires you to write scripts.

true river
#

so that means that some of the parts will run on my pc and not the server?

cunning heath
true river
livid glacier
cunning heath
livid glacier
cunning heath
livid glacier
#

why would making MORE on the CLIENT reduce lag

true river
cunning heath
true river
#

but there is too much stuffs going on which breaks the machines

cunning heath
#

Could perhaps make it so only some run when the player decides to view them

livid glacier
#

i tought he would get low fpscatcloseup

true river
livid glacier
#

If its because of network just keep all machines in replicatedstorage and move them out via. code

true river
#

to like only see the parts which are inside the 20-30 studs area

livid glacier
#

then they will be rendered on every client individually

#

and do not try to sync with every client

livid glacier
cunning heath
#

wa. Could you check your Perfomance stats. So we can see what causes the lag

cunning heath
#

40 should be alright tho. And what about your fps

true river
#

its not me who lags

#

but the machines

true river
#

i dont know how to move them out from there via scripts sadge

livid glacier
#
  1. Make a Folder in ReplicatedStorage
  2. Move all your models (ur machines) in there
  3. Run smth like this in game.StarterPlayer.StarterPlayeerScripts.moveModels.luau (ur script is moveModels.luau, its just a local script)
-- Contents of moveModels.luau

local FOLDER = game.ReplicatedStorage.Folder --replace "Folder" with ur folder name

local function moveModels(folder)
    local models = folder:GetChildren()

    for _, model in models do
        model.Parent = game.Workspace
    end
end

moveModels(FOLDER)
true river
#

thank you i try it

terse hollyBOT
#

studio** You are now Level 2! **studio

livid glacier
#

show me ur script

true river
true river
#

and ran the cmd..

livid glacier
#

well

#

you cant make parts only local without scripts

true river
#

thanks tho for helping

livid glacier
#

np

gusty radish
#

WTF bloody hell is this sorcery?

real oyster
true river
#

takes less time to create, with inefficiency

real oyster
#

i js realized thats a smooth brain emoji

#

i did not mean to diss you brocrying

#

But to make your game work context to how it works is needed

true river
#

Just basic movements without scripts

#

made too much

#

some of them freeze

muted bison
real oyster
#

Without scripting your options are accepting the lag or nuking the # of parts you have

terse hollyBOT
#

studio** You are now Level 5! **studio

real oyster
#

Load them locally if players don’t need to interact and load them only near the player