|
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 |
|
cfiredogJoin Date: 2008-05-30 Post Count: 228 |
I would suggest trying to use :MoveTo in order to move the bricks.
http://wiki.roblox.com/index.php?title=API:Class/Model/MoveTo |
|
|
oh hey,
The bricks move seperately using a complicated iterating system, so moving the whole model wouldnt help. |
|
cfiredogJoin Date: 2008-05-30 Post Count: 228 |
Oh, so you are trying to move each part separately at different time periods? |
|
|
pidgeyJoin Date: 2008-01-16 Post Count: 2739 |
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 |
|
|
Well my code is complex but it is differnet. |
|
pidgeyJoin Date: 2008-01-16 Post Count: 2739 |
tell me why you're doing it and i might be able to help?????
pidgey is my name sh##posting is my game |
|
cfiredogJoin Date: 2008-05-30 Post Count: 228 |
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 |
|
|
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
|
|
pidgeyJoin Date: 2008-01-16 Post Count: 2739 |
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 |
|
pidgeyJoin Date: 2008-01-16 Post Count: 2739 |
yeah i cant help but ill take that +1 post
pidgey is my name sh##posting is my game |
|
|
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. |
|
|
"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. |
|
|
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 |
|
|
|
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. |
|