Okay so, I'm replicating the CFrame of another humanoid object controlled by the character with calling a remote event and passing the parts for arguments. The server then fires the client event to all the clients and the client sets the cframe of the limbs, but this doesn't work. Help?
Localscript fires this every 5 frames during a RunService.Renderstepped event
if (replicationTimer % 5) == 0 then StandEvent:FireServer("Replicate", { Stand.HumanoidRootPart.CFrame, Stand.LeftFoot.CFrame, Stand.LeftHand.CFrame, Stand.LeftLowerArm.CFrame, Stand.LeftUpperArm.CFrame, Stand.LeftUpperLeg.CFrame, Stand.LowerTorso.CFrame, Stand.RightFoot.CFrame, Stand.RightHand.CFrame, Stand.RightLowerArm.CFrame, Stand.RightUpperArm.CFrame, Stand.RightUpperLeg.CFrame, Stand.UpperTorso.CFrame, Stand.Head.CFrame }) end
Server then fires to all clients
if request == "Replicate" then TestStandEvent:FireAllClients(player, arrayOfLimbs) end
Client Event
StandEvent.OnClientEvent:Connect(function(Player, arrayOfLimbs) if Player and Player.Character:FindFirstChild("HumanoidRootPart") then StandTorso.CFrame = arrayOfLimbs[1] Stand.LeftFoot.CFrame = arrayOfLimbs[2] Stand.LeftHand.CFrame = arrayOfLimbs[3] Stand.LeftLowerArm.CFrame = arrayOfLimbs[4] Stand.LeftUpperArm.CFrame = arrayOfLimbs[5] Stand.LeftUpperLeg.CFrame = arrayOfLimbs[6] Stand.LowerTorso.CFrame = arrayOfLimbs[7] Stand.RightFoot.CFrame = arrayOfLimbs[8] Stand.RightHand.CFrame = arrayOfLimbs[9] Stand.RightLowerArm.CFrame = arrayOfLimbs[10] Stand.RightUpperArm.CFrame = arrayOfLimbs[11] Stand.RightUpperLeg.CFrame = arrayOfLimbs[12] Stand.UpperTorso.CFrame = arrayOfLimbs[13] Stand.Head.CFrame = arrayOfLimbs[14] end end)
You can't do this with a typical Roblox character, because they are rigged with Motor6D constraints connecting all the parts. Motor6Ds are like welds, they will prevent you from setting the MeshPart CFrames independently. If you were to remove all the Motor6D joints, and anchor all the body parts, you would see your changes replicate, though it would look very jerky at this slow replication rate. If you want to keep the character rigged, you have to be manipulating the Motor6Ds, not the MeshParts directly. Exactly what this entails depends on how the source character is being controlled. If it's using Roblox animations, you'll probably want to sync the animation on the client, because manually replicating the Motor6D.Transform is more trouble than it's worth IMHO. That said, if you feel like you want to try it, I can explain how.