Hey there! I’m trying to create a handcuff system for a game I’m working on, and I’m wondering how to weld a part (the handle of the handcuffs) to the player’s HumanoidRootPart. I’m not an expert with CFrame & welding, so I don’t really know where to start. If you have any idea how to do this, please tell me, as the system I have right now (just setting the position) is really choppy and not ideal for UX.
Try using WeldConstriaints! They’re quick and easy to use/create.
local Root = nil --Set this to the HumanoidRootPart
local Handle = nil --Set this to the Handle
local Weld = Instance.new("WeldConstraint")
Weld.Part0 = Handle
Weld.Part1 = Root
Weld.Parent = Weld.Part0
WeldConstraints are easier to use than normal welds, but if you need to be absolutely certain the offset is perfect, you can use normal welds such as:
local Root = nil
local Handle = nil
local Weld = Instance.new("Weld")
Weld.Part0 = Handle
Weld.Part1 = Root
Weld.C0 = CFrame.new() -- Set this to your desired offset
Weld.Parent = Weld.Part0
This example forcibly welds it to the CFrame offset you specify, in this case (0,0,0) since CFrame.new()
is just a blank CFrame.
WeldConstraints are much easier to use (since its offsets are set automatically), so if you’re just looking for an easy system and/or don’t know how to use C0, I would use those.
When I used weld constraints for this purpose, it made player movement all wonky.
As in, you can only move in specific directions at a reduced pace or can’t move at all in some cases.
Was there something I missed?
Yeah, I’ve seen this happen sometimes. I believe the problem is up to network ownership, since it works just fine with NPCs, as far as I’ve tested. However, I’ve never personally made a player-to-player weld, but since it works fine with npcs I think that’s probably the issue.
I could be totally wrong though.
Its should be noted that the new welds do not work correctly with the current characters and humanoids. I recommend using motor 6ds or normal welds as they work better.