What are all the possible things that can cause major lag and how to prevent them

Through my experience as a modeler and an inexperienced builder, I’ve come to know that triangles, unions, and parts all-cause lag however you’ll only need an overbearing amount of them to actually cause harmful lag to your game. This is where the problem comes in, a project we’ve been working on has only 1500+ parts however the game is laggier than the games with over 7000+ parts which just confuses me. So I’m wondering if there are more things that cause lag than just parts and triangles. Thank you for reading and please answer my question if you can.

7 Likes

Just for extra context we do have scripts and a few terrain I seriously can’t tell if scripts can cause lag however I do know terrain can cause lag.

1 Like

Depending on your terrain size and the parts you have it could be anything from viruses to not anchoring stationary blocks. Look up the micro profiler and how to use it to determine where your lag is coming from. Heck just hit Ctrl+F6 and look around the map and watch the bar at the top to find lag spikes. then go from there. If you not scripting yourself and are using other people’s scripts and or anything off the free shop you could be infested with viruses. Run the game in test mode and go through your explorer ad look for scripts that shouldn’t be there… If your loaded to the gills with viruses Id recommend dumping all your scripts and moving over to another server once you get the lag to quit, if you can.

1 Like

How much of the game is terrain, union’s, or other laggy things that can understate a part count? lag really depends on the amount of these things which isn’t really specified, I recommend you make a copy of the game and try deleting some less-important aspects to the place and see how much lag changes. If said changes work without effecting gameplay, then you can transfer it to main game.

Definitely in my experience, the main cause of lag has been scripts. When I say this I mean constant loops or parts being replicated or created. These are definitely areas you’d need to take great caution in when making a smooth game. As far as building, like previously mentioned; unanchored parts is a big one, moving parts (that hit other moving parts or even stationary) and parts that are replicated on accident and without notice tend to add onto the load.

Another thing to keep in mind, viruses are a big reason for lag and they tend to come randomly at times. Some come from plugins with backdoors, others from free-models.

2 Likes

Damn alr I never knew that kind of tool existed I’ll check it out thanks.

Ah alr I do have a bunch of unanchored dummys so…

Its easy to fix just remember to click on “workspace” in the explorer then hit the anchor button in model. that will anchor everything on the map. Just remember to un-anchor anything you dont want anchored.

Ctrl+N	New	Create a new place.

Ctrl+O Open from file… Open an existing local file.
Ctrl+Shift+O Open from Roblox… Open a recent game from Roblox.
Ctrl+W or Ctrl+F4 Close file Close the active place or file.
Ctrl+S Save to file Save the active place to a local file on your computer.
Ctrl+Shift+S Save to file as… Save the active place to a local file with a new name.
Ctrl+P Quick Open Show the Quick Open window to quickly find any instance in the game.
Alt+G Toggle grid Show or hide the 3D grid on the Y plane.
Alt+X Toggle Explorer Open or close the Explorer window.
Ctrl+Shift+X Jump to Explorer filter Jump to the Explorer window filter input field.
Ctrl+Shift+P Jump to Properties filter Jump to the Properties window filter input field.
Ctrl+I Toggle Advanced Objects Open or close the Advanced Objects window for quick insertion of objects. After opening, type the name of the object you want to insert and press Enter to insert it.
F12 Video record Record a video.
Alt+S Settings… Open the Roblox Studio settings window.
Camera Controls
Key / Shortcut Action Description
W or Up Arrow Forward Move the camera forward.
S or Down Arrow Back Move the camera back.
A or Left Arrow Left Move the camera left.
D or Right Arrow Right Move the camera right.
Q Down Move the camera down.
E Up Move the camera up.
Shift Change camera speed In combination with any movement key, changes the camera speed (camera speed can be customized within Studio settings).
Right Mouse Button Turn the camera Hold and drag to freely move the camera view around.
Middle Mouse Button Pan the camera Hold and drag to pan (slide) the camera.
Mouse Scroll Wheel Zoom in or out Zoom the camera in or out.
Ctrl+= Zoom in Zoom the camera in.
Ctrl± Zoom out Zoom the camera out.
F Focus Focus the camera on a selected part.
, Rotate left Rotate the camera left. If a part/model is in focus, rotate counterclockwise around it.
. Rotate right Rotate the camera right. If a part/model is in focus, rotate clockwise around it.
Page Up Pitch down Pitch the camera down. If a part/model is in focus, pitch camera down about it.
Page Down Pitch up Pitch the camera up. If a part/model is in focus, pitch camera up about it.
[ Undo camera move/shift Undo the last camera move/shift.
] Redo camera move/shift Redo the last camera move/shift that was undone.
General Editing
Key / Shortcut Action Description
Ctrl+C Copy Copy the selection and add it to the clipboard.
Ctrl+V Paste Paste contents of clipboard.
Ctrl+X Cut Cut the selection and add it to the clipboard.
Delete or Backspace Delete Delete the selection.
Ctrl+Z Undo Undo the last action.
Ctrl+Shift+Z or Ctrl+Y Redo Redo the previously undone action.
Ctrl+A Select all Select all parts in the workspace or all lines in a script.
Ctrl+Shift+V Paste into Pastes the object currently on the clipboard as a child of the selected object.
Selecting/Editing Parts
Key / Shortcut Action Description
Ctrl+1 Select tool Select a part/model.
Ctrl+2 Move tool Move a selected part along an axis by dragging the corresponding arrow.
Ctrl+3 Scale tool Resize a selected part by dragging the corresponding handle.
Ctrl+4 Rotate tool Rotate a selected part by dragging the corresponding handle.
Alt+A Anchor Anchor or un-anchor selected object(s).
Ctrl+D Duplicate Clone the current selection and put it at the same level in the Explorer hierarchy.
Ctrl+G Group Group selected parts into a new model.
Ctrl+U Ungroup Ungroup selected model(s) into individual parts.
Alt+Left Mouse Button Select within model Select an individual part within a model (as opposed to selecting the entire model).
Shift+4 or Alt+R Jump to Rotate increment Jump to the Rotate increment input field in the Model tab.
Shift+2 Jump to Move increment Jump to the Move increment input field in the Model tab.
Ctrl+T Rotate about X axis Rotate selection about its X axis (alternatively, press T while dragging for same effect).
Ctrl+R Rotate about Y axis Rotate selection about its Y axis (alternatively, press R while dragging for same effect).
Ctrl+L Toggle local Toggle Move and Rotate tools between local and world coordinates.
Alt+L Lock tool Lock or unlock object(s).
Ctrl+Shift+G Union Fuse parts together to make a single part.
Ctrl+Shift+N Negate Negate parts, useful for making holes.
Ctrl+Shift+U Separate Separate parts from a fused selection.
Scripting
Key / Shortcut Action Description
Tab Indent Add an indentation. Can also be used to indent every line of a selected text block.
Shift+Tab Un-indent Remove an indentation. Can also be used to un-indent every line of a selected text block.
Ctrl+F Find in script Find the specified string within the script currently being viewed.
F3 Find next Find next instance of specified string within the script currently being viewed.
Shift+F3 Find previous Find previous instance of specified string within the script currently being viewed.
Ctrl+Shift+F Find in all scripts Find the specified string within all scripts in the currently open place.
Ctrl+H Find and replace Find the specified string in the script currently being viewed and optionally replace it with a replacement string.
Ctrl+G Go to line Move the cursor to the specified line number in the script currently being viewed.
Ctrl+Mouse Scroll Wheel Zoom script in or out Zoom the script view in or out.
Ctrl+= Zoom script in Zoom the script view in.
Ctrl± Zoom script out Zoom the script view out.
Ctrl+0 Reset script zoom Reset the script zoom to normal.
F11 Step into When debugging with breakpoints, step into the next block.
Shift+F11 Step out When debugging with breakpoints, step out of the current block.
F10 Step over When debugging with breakpoints, step over the next block.
Ctrl+E Expand all folds Expand all collapsed folds in the script.
Ctrl+Shift+E Collapse all folds Collapse all collapsable sections of the script.
Ctrl+Shift+C Toggle comment status Toggle the commented status of the selected lines.
Testing and Publishing
Key / Shortcut Action Description
F5 Play/pause Start playing your game in Studio. Press again to pause the simulation.
Shift+F5 Stop Stop simulation of your game.
F6 Play solo Launch Studio in solo player mode.
F7 Start server and client Simulate the Roblox environment by starting two new sessions of Studio: one running a virtual server and the other a virtual client (player).
Alt+F7 Start client Start a new session of Studio running a virtual client (player).
Alt+Shift+P Publish to Roblox as… Publish the currently open place to a new slot on Roblox.
Alt+P Publish to Roblox Publish the currently open place to its slot (it must have already been published).
Ctrl+Shift+F1 Show stats data Show detailed game stats.
Ctrl+Shift+F2 Show render data Show detailed graphics and performance data.
Ctrl+Shift+F3 Show network data Show detailed network stats.
Ctrl+Shift+F4 Show physics data Show detailed physics data.
Ctrl+Shift+F5 Show summary data Show a summary of stats data.

2 Likes

the owner and I’ve checked using the methods you said and we can’t find any lag spikes nor any viruses. However we did knew there were a bunch of unanchored dummies so we removed them, anchored everything, and deleted all the terrain we had yet still the performance didnt become as good as we thought it would be. I’m guessing its the script’s fault then thanks doe for helping!

No problem. Adding waits and debouncing to your scripts can help. WaitForChilds and looking for inf loops and fixing those as well. If your part count it high and you have a lot of scripts that can cause lag as well.

im currently trying to work out how to balance scripts on a 500kx500k map with 197k part count lol so I getcha

Damn alr, is the map gonna be playable later on?

I hope so. Otherwise, it’s 4 months of work down the turlet.


Is the game insanely laggy or no? Because if it’s not then I’ll have some moral support in freely making as many assets as I want lol.

As i am more of a scripter, this could be a scripting issue with loops (while true do and repeat until loops.)