How to weld destructible model without Primary Part?

Alright. I have a sailboat with multiple parts. I wanted to make a weld script that can weld all my ships in the game. I plan to have ships with many parts to make them destructible.

Problem:
In a weld script, if you weld something in a weld script and weld it to a primary part, if you destroy other parts that the part is connected to that part will still be floating. Imagine destroying all the masts of a ship but the sail cloth is still floating and welded to the ship. That is the problem. I cant weld everything to a primary part I need to weld things to the parts they are in contact with. I know I can use join surfaces as im building but I need a script so it will be faster.

You’ll need to connect every part to every other touching part. You could use spatial queries to find out which parts any given part is touching. IIRC there’s a wiki article on “spatial queries”

1 Like