Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Should I avoid using the deprecated MakeJoints()?

Asked by 4 years ago

I'm rewriting the classic btools (copy, move, etc) so that they work exactly as intended for modern Roblox, and for the copy tool, I've finished the system where the copied brick will go to the first available spot above the original brick. This worked great, and then I wanted it to be able to connect it to the original block if the surfaces matched; I'm using stud-and-inlet bricks which is handy because they automatically attach together. I was wondering how I could do it when a Google search brought me to the developer page for the MakeJoints() Function. This is useful to me, because it does exactly what I wanted, but I'm now cautious because of the warning at the top of the page:

Deprecated

SurfaceType based joining is deprecated, do not use MakeJoints for new projects. WeldConstraints and HingeConstraints should be used instead

This concerns me, because my game and the btools really depend on using studs and inlets. I really don't want to go out of my way to get it to work using WeldConstraints, because this works well enough and I'm going to be using the old look regardless. So, is this something I should avoid? I feel like labelling this as deprecated isn't right, considering how many games still use the SurfaceType based joining.

1 answer

Log in to vote
1
Answered by
iuclds 720 Moderation Voter
4 years ago
Edited 4 years ago

Welding each part with WeldConstraints is much better at the least, but I wouldn't say they are the most efficient. You can weld every part inside a model with GetDescendants() and weld it to the part you would like.

Here's a code example.

for i,v in pairs(model:GetDescendants()) do
    if v:IsA('BasePart') and v.Name ~= 'MainPart' then
        local w = Instance.new('WeldConstraint')
        w.Parent = v
        w.Part0 = v
        w.Part1 = model.MainPart
    end
end

MakeJoints is much better because of how fast it is. Writing all that code just to join a model is unnecessary and the engineers can make a new function for that.

0
So do you think I'm safe to ignore the warning and use MakeJoints anyway? it would be a really convoluted process for me use WeldConstraints since I'm not grouping copies parts together. MrBlockyhead 84 — 4y
0
use my code* iuclds 720 — 4y
0
Oh, I would but it's not exactly what I need because the parts that I need to weld are not in a model and are disorganized, since players will be copying parts all over the place. I did find a solution though, which is the function Workspace.JoinToOutsiders() and giving it an array of just the copied part. That welds it to any other parts that it's thoughing. But thanks anyway! MrBlockyhead 84 — 4y
0
touching* MrBlockyhead 84 — 4y
Ad

Answer this question