Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How can I make a brick unweld other bricks when it passes through the welded bricks?

Asked by 8 years ago

So I want to make a brick that is moving with velocity and when it comes into contact with parts of a building that are unanchored but welded, these parts will then unweld and the building will fall apart.

So far my script looks like this

function onTouched(hit)
hit:BreakJoints()
end

connection = script.Parent.Touched:connect(onTouched)

This does not currently work and I'm a bit stuck on what to do.

2 answers

Log in to vote
0
Answered by 8 years ago

How about using an explosion - you can add this effect to the part that hits, and adjust the amount of force etc.

local E = Instance.new("Explosion")
E.BlastRadius = 10 -- 10 studs around will be affected
E.BlastPressure = 500000  -- adjust to knock down your wall
E.DestroyJoinRadiusPercent = 5 -- you can adjust this also - defaults to 1
E.Parent = Part -- you can parent it to the part or the hit
Ad
Log in to vote
-1
Answered by 8 years ago

I'll try that.

Upon further testing I found out the script I originally posted worked, but thanks for answering as well, I'll make sure to keep it in mind.

Answer this question