I kind of messed up in my last post which will be linked, but I’m re-writing it to make things clearer.
I want to CFrame a model to make it look as if it is following my character without using SetPrimaryPartCFrame() as it slowly rips the model apart. I tried using Weld Constraints to do this by Welding each part of the model to the Primary Part of the model and then loop CFraming the Primary Part to where I wanted it to be (next to my characters head/above its shoulder.) The Weld Constraints did not hold the model together when anchored and only the Primary Part of the model was moved to where I wanted it. But when I unanchored the parts, the entire thing fell apart.
Here is the code I am trying to use (I also messed this up slightly in my last post, so here is the updated version)
ghost = script.LastCityGhost -- Model name
decs = ghost:GetDescendants()
local HRP = script.Parent.HumanoidRootPart
for i,v in pairs(decs) do
if v.ClassName == "MeshPart" then
local weld = Instance.new("WeldConstraint",ghost.PrimaryPart)
weld.Part0 = ghost.PrimaryPart
weld.Part1 = v
v.CanCollide = false
end
end
game:GetService("RunService").Stepped:Connect(function()
ghost.PrimaryPart.CFrame = CFrame.new(HRP.CFrame * Vector3.new(1.5,3,0))
ghost.PrimaryPart.Orientation = HRP.Orientation * Vector3.new(0,math.rad(-90),0)
end)