How can I weld all boxes in a van?

Hello everyone. I have made a van and a carry tool for my game to load boxes into the van. The problem is that there is a ton of unwelded boxes and this happens:
image
I have tried several things to weld the boxes to the van but all of them failed.

Full list of things I've tried

Method 1: running workspace:MakeJoints() on parts in a Region3

Total fail: regular scripts cannot call workspace:MakeJoints().

Methods 2 and 3: adding parts in a Region3 to a model and calling Model:MakeJoints()/welding each part in Region3

Another failure, Region3 is always empty for some reason.

Method 4: using WeldConstraint when the box is touched after dropping it

It welds, but the box floats in the air. Not the thing I need.

Method 5: calling Part:MakeJoints()/workspace:JoinToOutsiders() on parts of the van when they are touched

In this case, .Touched doesn’t always fire on parts of the van + too many events to connect.

Method 6: welding the box when it’s touched

This one works a bit, but the problem is that .Touched doesn’t always fire in this case. I’m not sure why this happens.

What can I try to solve this problem?

EDIT: for the most clarity, I am trying to weld the box to any part inside of the van.

I don’t know exactly what you are trying to do but from what it seems like I would weld the boxes onto the floor of the inside of the van, or event the walls. As long as it is inside of the van when welded then it should be fine.

What you need to do is add a touched event so whenever the boxes touch the inside of the van, they add a weld constraint to it. All you have to do is weld the part to the van. Look on here to see how to create a weld constraint between 2 parts: WeldConstraint | Documentation - Roblox Creator Hub

You got me right. I am trying to weld boxes to the floor (or any other part) of the van.

There are 8 parts for walls and 5 for the floor. Making 13 connections isn’t the best way to do it.

This was one of the methods I tried, but it resulted in boxes looking like they are floating.

So all you need to do is add a wait for about 4 seconds so that they are completely on the floor before you weld them.

1 Like

you can also do :GetTouchingParts()

and if the table size is 0 then don’t weld

image
EDIT: Whoops, forgot to add a check if the part belongs to van.
EDIT 2: Looks cool with 1 part. Let’s see if it works with more.

Thank you very much! I didn’t know that a simple wait(4) can fix my game.