I have a belt that I’ve cloned from ReplicatedStorage, attached, and welded to a player’s torso (happens after they click a button).
The belt successfully clones and welds (using WeldConstraints), but is not in the right position. I’ve tried a dozen things with Vector3 but am unsure how to proceed.
So I found a solution that only uses the player’s torso and the belt.
The easiest way I use to change the weld’s position is to change the CFrame of the weld.
local button = script.Parent
local clickDetector = button.ClickDetector
local belt = game.ReplicatedStorage.Belt
clickDetector.MouseClick:Connect(function(plr)
local char = plr.Character
if char:FindFirstChildOfClass("Humanoid") then
button.BrickColor = BrickColor.new("Really red")
local chest = char.Torso
local clonedBelt = belt:Clone()
clonedBelt.Parent = char
clonedBelt.CFrame = chest.CFrame -- Setting the position of the belt to the players torso
local weld = Instance.new("Weld", clonedBelt.Parent) -- Using Weld instead of WeldConstraint, seems to work better
weld.Part0 = clonedBelt
weld.Part1 = chest
weld.C0 = CFrame.new(0, 0.8, 0) * CFrame.Angles(math.rad(90), 0, math.rad(90)) -- Change C0 on the Y-Axis here to change the position of the belt, up and down
weld.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(math.rad(90), 0, math.rad(90))
print("Step 4")
end
end)
Using this method it should look something like this hopefully.