Solutions to eliminate desync when connecting a part to an anchored part with a rope

What do you want to achieve?
I want to connect 2 parts with a rope:

  • First part is an anchored part that moves by setting CFrames
  • Second part is a HumanoidRootPart of n character

I want to achieve this without causing desync.
I am creating an additional part to make sure that an exploiter can’t affect the other player using the rope, I know it only eliminates the connected player but it’s better than nothing

What is the issue?
The issue is that connecting a part to an anchored part with a rope causes desync.
Here are videos which demonstrate the issue:

In the first video the issues is still present in BOTH dummies because:
The dummy that is owned by the server:

  • Stays in place in player’s POV
  • Moves around behind the player in server’s POV

And the dummy that is owned by the player:

  • Moves around behind the player in player’s POV
  • Stays in place in server’s POV

What solutions have you tried so far?

This issue can be solved by replacing anchoring with AlignOrientation and AlignPosition but the anchored version seems more exploiter proof and is way more clean to do, but I will do it if I can’t find another way.

Another solution I thought of was to force update the position on each client with remote events but that would be a lot of remote firing and I don’t know if it would be the efficient to do that

This is the script which creates the rope. I can’t include the full script since it uses functions and classes which would need more explaining so I just shortened it to the most important bits.
This is in a server script:

-- u_root is the hrp of the person using the move (is dragging the other person with the rope)
-- h_root is the hrp of the person who got hit by the move (is being dragged with the rope)

-- Create attachments for the rope
local h_att = Instance.new("Attachment")
h_att.Parent = h_root	
local u_att = Instance.new("Attachment")
u_att.Parent = part

-- Create follow part
local part = Instance.new("Part")
part.Size = Vector3.new(1,1,1)
part.Transparency = 0
part.Color = Color3.fromRGB(255,0,0)
part.CanCollide = false
part.CanQuery = false
part.CanTouch = false
part.Anchored = true
part.CFrame = u_root.CFrame
part.Parent = debris_folder

-- Make follow part follow the player 
UniversalUtils.followPart(part, u_root, CFrame.new(0,0,0)) -- Makes the part follow u_root with 0,0,0 offset

-- Create rope
local rope = Instance.new("RopeConstraint")
rope.Visible = true
rope.Color = BrickColor.new("Tr. Green")
rope.Length = 8
rope.Restitution = 0.125
rope.Attachment0 = u_att
rope.Attachment1 = h_att
rope.Parent = part

EDIT:
Another important thing I didn’t mention is that if the person that is dragging the other player stops moving for roughly 2/3 seconds the positions update to the correct ones.

2 Likes

Did you replicate the rope to the server? I don’t know if this is a good solution, but try making the player you attach to massless on the server and how that goes.

The rope is created on the server, and the massless solution shouldn’t work because anchored parts have infinite mass I think, but I’ll try it, thank you!
edit: didn’t work

Have you tried setting the humanoid state to ragdoll?

Just tried it now and it unfortunately didn’t work

The only other thing I can think of is to manually set networkownership of the rope and if possible the other player character as well.

The rope doesn’t have network ownership related functions and the part is automatically server owned since it’s anchored. The player character solution wouldn’t work either since it didn’t work with the dummy that was network owned by the player (in the first video).
Thank you for help, I really hate these physics replications issues I always have to go for very unintuitive solutions because of them. I wanted to go for the AlignPosition solution but it has a lot of issues so I can’t really use it. The only solution left now is the manually updating position for each client, but that’s a last resort thing.
Do you have an idea on how I could replicate a similiar behaviour to that of a rope without actually using one? It’s important to me that:

  • The player that is dragged can’t affect the player that is dragging him in any way(with exploits for example) so the connection has to be “one way”
  • The player that is getting dragged keeps network ownership over his character

Sorry if this sounds like I’m working in the dark, as I’ve not had time to get onto studio, but…
If you remove the humanoid from the dummies they should just behave like regular collections of parts physics-wise, and so long as the network ownership of the dummy and the dragging part (or player) is the same they should do the physics calculations in sync (obviously rendering to clients may not be quite in time due to lag).
If this method works, then you can clone the character of the player being dragged, switch the camera behaviour, and hide the original somewhere until you need it again.
Anything the dragged player does will enact on the original, not the dummy.