Weld constraints not working with 2 anchored parts

I’m not completely sure if I picked the right category but if you have a weld constraint with 2 anchored parts it does not work. I want to connect an anchored part with an anchored sliding door. When I move the the part’s cframe in a script the sliding door does not move with it. I’m not sure if there is another way to do this but I would like to know how I can use something like weld constraints to connect 2 anchored parts together and move them the same distance when moving one. If I unanchor the sliding door parts the script does not work.

1 Like

Anchored parts are their own root, independent from everything else.

If you want to use this pattern you should unanchor the stuff on the end of the weld that you want to move. The WeldConstraint will hold the parts in place, but you’ll be free to temporarily disable the WeldConstraint to move the parts separately.

2 Likes

I was going to say this in the post but I forgot to. If I unanchor the sliding doors the script does not work. I think it might be because it is using a tween to make it slide.

1 Like

If you want to tween it, you’ll have to use a Weld instead of a WeldConstraint, so that you can explicitly tween the C0 of the Weld.

2 Likes

Hi. I’ve been looking at posts because when I weld parts the part1 part in the weld has the same cframe as part0. I want them to work like weld constaints like how they don’t have the same cframe as part0 and when you move one part it moves the other the same amount. I tried using inverse but that did not work.

1 Like

That’s the cost of Welds: You get an explicit C0/C1 property to set / tween, but the weld will use exactly that C0/C1 to know how decide how to position the connected parts, rather than the positions they had.

You should be tweening the C0 or C1 property of the Weld to do it with that approach, not tweening either of the part positions. It will take some trial and error to find the C0 CFrames that you have to tween from / to.

4 Likes