I know this is a rookie question and although I’ve been coding for a few years now I have never figured this out. I need to weld parts using weld constraints in a script, like this.
However, everytime I do this, it moves the seat to the side a lot and I don’t know how to fix it.
If the parts are in Workspace before being welded, make sure they’re anchored before welding so that there is no time for physics to act on the parts. You can unanchor it after welding. Feel free to not worry about anchoring if the parts are not in Workspace.
Also, don’t the WeldConstraints have to be parented to something? I usually set the parent to one of the parts.
Oh I just noticed you are using the second parameter of Instance.new(), which is what to parent it to. This is typically bad practice because all the property modifications happen after the instance is created, which creates unnecessary change events - typically parenting is the last step you want to do. It won’t be the source of your problem, though.
So that just leaves the parts being acted on by physics briefly if they’re in Workspace before being welded.
So I tried deleting the second parameter, anchoring it first and unanchoring it after, and welding before I put it in workspace and still got this. I am cursed ig.
The picture above happens when I try to clone it to workspace (because I need to spawn it in)
So I thought maybe redoing the welds when I spawn it in will work.