Basically I have this backpack model, and inside the model there are multiple parts and unions, as well as this script:
local bp = script.Parent
local Character = script.Parent.Parent
bp.Parent = Character.Torso
bp:SetPrimaryPartCFrame(Character.Torso.CFrame)
for i,v in pairs(bp:GetChildren()) do
if v:IsA("UnionOperation") or v:IsA("Part") then
local w = Instance.new("Weld", v)
w.Part0 = v
v.CFrame = Character.Torso.CFrame
w.Part1 = Character.Torso
w.C0 = v.CFrame
w.C1 = Character.Torso.CFrame
v.Anchored = false
v.CanCollide = false
end
end
Now this script welds all of the parts to the player's torso, however all of the parts go to the exact same position(Inside the torso). Now after this I had an idea to give each part an offset value to position each part correctly this only changes line 10 of the code: v.CFrame = Character.Torso.CFrame * CFrame.new(v.Offset.Value) This works! BUT the second you rotate your player from the starting rotation, and then try and weld the backpack, the parts gets completely messed up. I'm wondering how I could fix this issue, or maybe there is a better way to weld models to players? This is literally my first time using welds please help!
Here is a video for more clarification: https://www.youtube.com/watch?v=fYBtweAd4qU
