How to make player built blocks stick together

I’ve made a grid block placement system that works pretty well, however since the parts are unanchored (it’s going to be destructable by explosions etc.) The blocks placed don’t seem to stick together.

I’m not sure if I’m doing something wrong but I tried to make all the surfaces “Weld” but that doesn’t work, if you push the block they seperate.

Is there away to make blocks created by the player to stick together without being anchored somehow?

Thanks.

Why would your blocks be unanchored. When the explosion happens, why don’t you just unanchor the bricks then?

I’m not sure if there was a better way. Most of the old destruction games had their bricks unanchored, and when they were hit by the old rocket launcher the welds would break and the parts would go flying. I was sort of trying to recreate that.

So why not you just weld all the parts together?

https://gyazo.com/5c86521d039056901a5409e4eb9c8e6f

It doesn’t work for some reason. The blocks surfaces are all “Weld” (you can’t see it because of the material)
but it just doesn’t stick.

Just insert a weld constraint. Weld the part and the ground together.

There’s been some changes to how Part surfaces work. You can read about it here and in the linked articles.

When moving parts via scripts, you might be able to use Workspace.JoinToOutsiders to get them to weld to touching parts. I’d recommend creating weld instances between parts from the script explicitly, to get exact control over which parts do and don’t weld together.

2 Likes

This still is not really a recommended method unless you need to do it at run time.

Use WeldConstraints in the Model tab.


Make sure you turn on “Show Welds” so you can see them!

You can select a group of parts and choose the “Weld” option from create and it will weld all touching parts together.

What isn’t recommended, calling JoinToOutsiders or creating Weld Instances? I meant the new WeldConstraints, just completely forgot there used to be the old instances with ClassName “Weld” :sweat_smile:

That seems to be what OP is trying to do:

Just to clarify: creating WeldConstraint Instances or calling JoinToOutsiders is fine if you have to connect parts at runtime, right?

Yea it’s fine. My personal preference is to write my own “join to outsiders” function that uses WeldConstraints, simply because JoinToOutsiders will create the older Weld instances, and usually I don’t actually want every touching part to weld, just a few. Also I can see the WeldConstraints if I turn on Show Welds while playing, and I don’t have to worry about them getting deleted automatically if I move a specific part or any other reason. Using WeldConstraints gives you more explicit control on when you want to add/remove or enable/disable welds at run time.

But, there’s no issue with using the old Weld instances, performance or otherwise.

1 Like