|
| 16 Jul 2016 02:16 AM |
Yes how would this be done because right now it lags the server the crap. Thanks :P
Current method:
while wait() do for i,a in pairs(bleh:GetChildren()) do a.CFrame = pos end end |
|
|
| Report Abuse |
|
|
cfiredog
|
  |
| Joined: 30 May 2008 |
| Total Posts: 228 |
|
|
| 16 Jul 2016 02:17 AM |
I would suggest trying to use :MoveTo in order to move the bricks. http://wiki.roblox.com/index.php?title=API:Class/Model/MoveTo |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 02:27 AM |
oh hey,
The bricks move seperately using a complicated iterating system, so moving the whole model wouldnt help. |
|
|
| Report Abuse |
|
|
cfiredog
|
  |
| Joined: 30 May 2008 |
| Total Posts: 228 |
|
|
| 16 Jul 2016 02:28 AM |
| Oh, so you are trying to move each part separately at different time periods? |
|
|
| Report Abuse |
|
|
| |
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 16 Jul 2016 02:30 AM |
WHY ARE YOU MAKING A LOOP TO KEEP PUTTING A BUNCH OF OBJECTS IN THE SAME PLACE
pidgey is my name sh##posting is my game |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 02:31 AM |
| Well my code is complex but it is differnet. |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 16 Jul 2016 02:32 AM |
tell me why you're doing it and i might be able to help?????
pidgey is my name sh##posting is my game |
|
|
| Report Abuse |
|
|
cfiredog
|
  |
| Joined: 30 May 2008 |
| Total Posts: 228 |
|
|
| 16 Jul 2016 02:33 AM |
Then I would use this method:
for _,v in pairs(game.Selection:Get()) do v.CFrame = v.CFrame * CFrame.new(0, 0, 0) end
via ROBLOX Wiki: http://wiki.roblox.com/index.php?title=CFrame |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 02:35 AM |
well.
There is a main part, which goes in the lookVector of itself, which can be changed with the arrow keys.
Now, theres 100 parts behind following it, with a delay as it goes further down.
So how would I make this not as laggy :P
|
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 16 Jul 2016 02:38 AM |
one at a time, not all at a time like the script you posted
make a wait time in the pairs function and in the wait function
but if you're trying to move tons of parts at once like that it will lag a lot more no matter what
pidgey is my name sh##posting is my game |
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 16 Jul 2016 02:39 AM |
yeah i cant help but ill take that +1 post
pidgey is my name sh##posting is my game |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 02:44 AM |
use RunService functions.
i would never use wait() for what it sounds like you're doing.
describe what your goal is, in a little more detail, and we will try to come up with an efficient solution. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 02:47 AM |
"make a wait time in the pairs function and in the wait function"
i don't know about roblox lua, but in the "normal" implementation of lua, you wouldn't want to use wait() like that. calling wait() for every object adds a lot of overhead in the backend i think because of C lua_yield and lua_resume functions being called. doing that would increase lag i am guessing.
just go over all of them at once. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 02:48 AM |
Thanks dearjournal.
Right now, (sry I forgot) Im using game:GetService("RunService").Heartbeat:wait()
Anyways, I'm making a 3d slither.io game. I used to have local movement and it worked fine, but when other plays moved around it only worked like 5fps for them.
So i decided to make it server side.
That means the server code is loading with remote events telling it what to do, maybe 5 models, with 20 parts inside each.
I cant use bodyforces since the little balls that make it up are anchored (for a reason)
Anyways should I make it generate a script for each model so one script isnt overloaded?
Tell me if i need to explain |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 Jul 2016 02:59 AM |
you shouldn't have to worry about a script being overloaded. it'd be more for design principles and readability, but each script body is essentially just an alias for a coroutine function anyways. doesn't matter if all your game is running from one server script and one local script, or 1,000.
i would definitely go back and try to re-implement it with FE. send only vital info to the server like what direction the player is choosing to go in.
some vital questions to ask:
-if you're using RemoteFunctions, are you sending entire Instances as arguments, or just vital information like a Vector3 telling where to move to next, etc.
I'm not too sure what your scripts setup is so I can't give you specific advice, sorry.
" server code is loading with remote events telling it what to do, maybe 5 models, with 20 parts inside each."
are you passing these Model Instances and Part Instances as arguments in a looped wait() function? this might be the cause of the lag and I would suggest doing a redesign based on sending only user input to the server.
there will be a delay but you can compensate by moving the players snake on the client with a localscript while you wait for the server to send back feedback on the users movement input. |
|
|
| Report Abuse |
|
|