Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How come my model disappears when unanchored after being welded? [SOLVED]

Hi. So I'm creating a vehicle and I have to have PGSPhyiscsSolverEnabled disabled for my project. Now here is the problem. I have narrowed it down to the weld script. For some reason, after it's done welding it unachore's the whole model. In this case a vehicle. But for some reason right after it's unanchored it disappears from the workspace. When PGSPhyiscsSolverEnabled is enabled this is not the case. So what am I doing wrong? Here is the weld script.

function weld()
	local parts,last = {}
	local function scan(parent)
		for _,v in pairs(parent:GetChildren()) do
			if (v:IsA("BasePart")) then
				if (last) then
					local w = Instance.new("Weld")
					w.Name = ("%s_Weld"):format(v.Name)
					w.Part0,w.Part1 = last,v
					w.C0 = last.CFrame:inverse()
					w.C1 = v.CFrame:inverse()
					w.Parent = last
				end
				last = v
				table.insert(parts,v)
			end
			scan(v)
		end
	end
	scan(script.Parent)
	for _,v in pairs(parts) do
		v.Anchored = false
	end
end

weld()
script:Remove()

1 answer

I fixed the vehicle. It turns out it was not the script but a BodyAngularVelocity object in the vehicle seat. It turns out the P for it was so large that it got the Roblox engine confused and just made it disappear.

This discussion is preserved as it was. New answers, comments, and votes are closed.