Basepart objects not replicating to clients

Objects behaving as physical matter are not replicating from the server to clients. I have no idea why, but here’s some information that may or may not help solve the issue.

I won’t reveal what the game is about, but I will say that it is a VR game, and characters do not have limbs in the game. It has two places, with one being the start place. Now, I will show you all the scripts I have written.

A normal script on the server (not in start place):

game.Players.PlayerAdded:Connect(function(player)
	player:LoadCharacter()
	player.Character.Archivable = true
	for x, object in ipairs(player.Character:GetDescendants()) do
		object.Archivable = true
	end
	local character = player.Character:Clone()
	player.Character:Destroy()
	local att = Instance.new('Attachment')
	local hrp = character:WaitForChild('HumanoidRootPart')
	att.SecondaryAxis = Vector3.new(0,0,1)
	att.Axis = Vector3.new(0,1,0)
	att.Parent = hrp
	local ao = Instance.new('AlignOrientation')
	ao.AlignType = Enum.AlignType.PrimaryAxisParallel
	ao.Attachment0 = att
	ao.Attachment1 = game.Workspace.Baseplate.Attachment
	ao.Responsiveness = 200
	ao.Parent = hrp
	character:WaitForChild('Humanoid').PlatformStand = true
	for x, part in ipairs({'LeftFoot','LeftHand','LeftLowerArm','LeftLowerLeg','LeftUpperArm','LeftUpperLeg','RightFoot','RightHand','RightLowerArm','RightLowerLeg','RightUpperArm','RightUpperLeg'}) do
		character:FindFirstChild(part):Destroy()
	end
	for x, part in ipairs({hrp, character.UpperTorso, character.LowerTorso}) do
		part.CollisionGroup = 'paddles1'
	end
	local lhand, rhand = Instance.new('Attachment'), Instance.new('Attachment')
	lhand.Parent, rhand.Parent = hrp, hrp
	game.Workspace.RPaddle1.Handle.AlignOrientation.Attachment1 = rhand
	game.Workspace.LPaddle1.Handle.AlignOrientation.Attachment1 = lhand
	game.Workspace.RPaddle1.Handle.AlignPosition.Attachment1 = rhand
	game.Workspace.LPaddle1.Handle.AlignPosition.Attachment1 = lhand
end)

A local script (not in start place):

vr = game:GetService('VRService')
game:GetService('RunService').PreSimulation:Connect(function(unusedVariable)
	game.Workspace.UpdateUserCFrame:FireServer(vr:GetUserCFrame(Enum.UserCFrame.Head),vr:GetUserCFrame(Enum.UserCFrame.LeftHand),vr:GetUserCFrame(Enum.UserCFrame.RightHand))
end)

I would be so thankful for some help, because I don’t even know what to try to fix it.

I think it’s because you don’t parent the cloned character

Sorry, I made a mistake. I accidentally left out a line. Here’s the correct code:

game.Players.PlayerAdded:Connect(function(player)
	player:LoadCharacter()
	player.Character.Archivable = true
	for x, object in ipairs(player.Character:GetDescendants()) do
		object.Archivable = true
	end
	local character = player.Character:Clone()
	player.Character:Destroy()
	local att = Instance.new('Attachment')
	local hrp = character:WaitForChild('HumanoidRootPart')
	att.SecondaryAxis = Vector3.new(0,0,1)
	att.Axis = Vector3.new(0,1,0)
	att.Parent = hrp
	local ao = Instance.new('AlignOrientation')
	ao.AlignType = Enum.AlignType.PrimaryAxisParallel
	ao.Attachment0 = att
	ao.Attachment1 = game.Workspace.Baseplate.Attachment
	ao.Responsiveness = 200
	ao.Parent = hrp
	character:WaitForChild('Humanoid').PlatformStand = true
	for x, part in ipairs({'LeftFoot','LeftHand','LeftLowerArm','LeftLowerLeg','LeftUpperArm','LeftUpperLeg','RightFoot','RightHand','RightLowerArm','RightLowerLeg','RightUpperArm','RightUpperLeg'}) do
		character:FindFirstChild(part):Destroy()
	end
	for x, part in ipairs({hrp, character.UpperTorso, character.LowerTorso}) do
		part.CollisionGroup = 'paddles1'
	end
	local lhand, rhand = Instance.new('Attachment'), Instance.new('Attachment')
	lhand.Parent, rhand.Parent = hrp, hrp
	game.Workspace.RPaddle1.Handle.AlignOrientation.Attachment1 = rhand
	game.Workspace.LPaddle1.Handle.AlignOrientation.Attachment1 = lhand
	game.Workspace.RPaddle1.Handle.AlignPosition.Attachment1 = rhand
	game.Workspace.LPaddle1.Handle.AlignPosition.Attachment1 = lhand
	character.Parent = game.Workspace
end)
1 Like

After ages of trying to fix this bug, I finally figured it out. The ReplicationFocus property on Player objects was set to nil. When it is set to nil, objects are replicated around the player’s original character’s primary part. I am cloning the character and deleting the old one, so the game doesn’t know what part to replicate objects around, so I had to set ReplicationFocus to the new humanoid root part after cloning the character and deleting it. I used the statement player.ReplicationFocus = hrp, with hrp being the new humanoid root part.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.