I’m trying to make a way for a player to detain another character, letting them walk around practically carrying them. I decided to use ManualWelds to do this, though the problem is that it seems to be extremely inconsistent. Sometimes it’ll work perfectly, though most times it’ll mess up completely with me being under the map, or with the other player having ownership over me. (somehow???)
My code:
Target.Character.Humanoid.PlatformStand = true
for _,v in pairs(Target.Character:GetDescendants()) do
if v:IsA("BasePart") then
v:SetNetworkOwner(plr)
end
end
local Weld = Instance.new("ManualWeld")
Weld.Name = "DetainWeld"
Weld.Parent = plr.Character.HumanoidRootPart
Weld.Part0, Weld.Part1 = Weld.Parent, Target.Character.PrimaryPart
Weld.C0 = Weld.Parent.CFrame:inverse()
Weld.C1 = CFrame.new((Weld.Parent.Position + Weld.Parent.CFrame.LookVector * 3), Weld.Parent.Position + Weld.Parent.CFrame.LookVector):inverse()
If anybody knows how to fix this, it would be greatly appreciated.
It looks like this same issue was addressed already in another post. If this does not solve your issue, then I am wondering if it is even possible to consistently override the player’s ownership of their own character. Player’s characters by default are owned by their player’s client.
After that’s done, assuming that the player is welded, you can weld the humanoid root part to the player’s left or right hand. I’d advise against using model:SetPrimaryPartCFrame() since it’s less than performant.
Sorry for not letting you guys know earlier, but I actually solved the issue by making the target character massless. I’m assuming this either took weight off my character and made it not bug out, or prevented it from being a RootPart, automatically resetting network ownership back to the client.