Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

When I move a part with a script in studio, it's smooth. When in game, it's laggy, fix?

Asked by 8 years ago

The title mainly explains it. How would I fix a laggy part in game, but not in studio? I use a body gyro to rotate it to my mouse, but thats about it except welds.

maincharpart.CFrame = maincharpart.CFrame + maincharpart.CFrame.lookVector*.1

1 answer

Log in to vote
0
Answered by 8 years ago

Latency
Are we there yet?

You're probably just using a regular Script, possibly in Workspace or ServerScriptService. What this means is that when you're running it in Studio, everything is happening on your computer, which is good because everything happens more or less instantaneously. When you run a Script on a normal Roblox server, all actions have to be replicated across the network, which means that the server has to tell your game "Hey the part is rotated like th- hey no it's rotated like this n- okay no it's like this again" and really it's just slow and has to cancel a ton of things out.

The solution?
Use LocalScripts. LocalScripts are good for anything which requires instant feedback, whether it's visual feedback or some other type of feedback, or stuff which needs to be smooth such as animations and tweening and stuff.

But I'm using FilteringEnabled
Tell the server. It's not really that different to what you were doing anyway, just this time you're using 2 scripts for it and it's better.

0
I know this reply is old, but this script is for script builder, and in a localscript. TheTurretCore 20 — 7y
0
Use FilteringEnabled. FilteringEnabled is cool. User#6546 35 — 7y
Ad

Answer this question