what I’m trying to do is just get every part in a folder and then make them move following their delays, that’s about it
but for some reason doesn’t work? and #moving:GetChildren() is returning 0, so my guess is it’s cause streamingenabled is true?
local core = workspace:WaitForChild("CoreGameplay")
local moving = core:WaitForChild("Moving")
for _, move in pairs(moving:GetChildren()) do
local constraint = move.PrismaticConstraint
local _delay = move.Delay
local ext_delay = move.ExtraDelay
local outPos = constraint.TargetPosition
wait(ext_delay.Value) -- im doing .Value just in case it changes
print(move.Parent)
while move.Parent == moving do
wait(_delay.Value)
constraint.TargetPosition = 0
wait(_delay.Value)
constraint.TargetPosition = outPos
end
end
this is all done in a localscript inside replicatedfirst so the platforms don’t become out of sync for any of the players
if that is the case, you should keep using the folder, but you have to call part:SetNetworkOwnership(player) on each of the parts within the folder from a server-script then animate it in the client. Not sure if this will ultimately fix the problem though, good luck.
even with streamingenabled turned off the script doesn’t work on the client, only the server, which makes me curious on how I could stop the platforms from lagging then? without manually setting their networkownership
Why not just use a Server Script that Tweens Anchored Parts with your unanchored platform Model Parts all welded to the Anchored Part.
The tweens will control the movement of the Anchored Parts on the server and the client would read that movement from there.
only reason I’m using a prismatic constraint is so the player can actually ride on the platform, from what I know players can’t actively ride on a tweening object
I don’t know if there’s a major difference but a lot of the platforms are not together or are supposed to be on different timelines
what would the difference be? currently constraints sometimes lag behind causing some jumps to be impossible because they aren’t “in sync” with the player
that’s why I initially thought to do it via the client
ReplicatedFirst runs scripts on the client particularly before anything in the server begins to load for the client. It is likely that Moving’s descendants have not been loaded when the script runs. In this situation, it is advised to run the script when all essential instances are loaded on the server.
When testing Constraints wait for a few seconds after loading the place. Physics seems to be one of the last things loaded into a place when testing. It can cause the lagging/jumping you describe.
Also if you have a CFramed or tweened item joined to a constraint it will be jumpy because CFraming drives one item and physics drives the other.
Anchored items on the server are probably the way to go because they don’t involve issues when one player gets close to a physics item and assumes Network Ownership, then another player gets close and has to deal with the 1st player’s ping to the server back to the 2nd player’s ping.
But as we have said, trying to synchronize data between players while running on the client isn’t great. You have the ping of loading it from the first client to the server to the other client.
If it’s server based you only have the one trip for the data.
It’s why animations may lag when you watch another player, or their movements aren’t smooth (they teleport instead of walk) when there is lag between client and server.
it wasn’t necessarily my goal to have it in sync with everyone I just wanted the physics to sync with the one client (kind of how tower of hell does it)
I will try this out though it seems like the best way of doing this probably