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

What does "BreakJoints()" do other than the obvious?

I am rather curious what BreakJoints() does to the parts involved other than the obvious. Does it change a property, set something to false? Change the sides to "Smooth" surfaces?

Is there more to "BreakJoints()" than what you see? If so, can you please explain?

Thanks :)

3 answers

✓ Accepted answer

All Snaps and Weld and Glue and Hinges &c are parts inside the JointsService.

The JointsService is just the place where all snaps are supposed to go.

When you call BreakJoints on a part or model, the game deletes all of the snaps involving those parts (most of which are in the invisible JointsService, but act just like other Welds or whatever that you've created)


The surfaces of parts themselves don't actually mean much: they only decide how MakeJoints() picks which types of snaps and which parts to snap together.


EDIT:

To find joints on a part is a little difficult. While the canonical place to put JointInstances is the JointsService, lots of scripts that add joints put them elsewhere.

To accommodate that, you would have to recursively scan the Workspace as well. To just find the joints that are made by MakeJoints() (from ROBLOX handling touching surfaces that snap) we just search through the JointsService:

function findJoints(part)
	local j = {};
	for _, joint in pairs(game.JointsService:GetChildren()) do
		if joint:IsA("JointInstance") then
			if joint.Part0 == part or joint.Part1 == part then
				table.insert(j, joint);
			end
		end
	end
	return j;
end

3 comments

0

How would one create a conditional statement checking to see if a part has joints? (Thanks for the answer by the way)

1

I have added a way to find joints made with MakeJoints to this answer

0

Thanks a lot. I really appreciate it.

BreakJoints tells the physics engine to break all the invisible welds in a model, thats about it

Other than breaking joints this can also to kill a players character. This is done automatically when the players health is 0. This is why your character breaks apart wen you die

"instance of player".Character:BreakJoints()

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