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

How do I make a part unanchor when an explosion touches it?

Asked by
LawlR 182
6 years ago

Not sure whether it requires scripting or not but I changed the ExplosionType and it doesn't seem to do anything.

2 answers

Log in to vote
3
Answered by
nilVector 812 Moderation Voter
6 years ago
Edited 6 years ago

What you are looking for is the Hit event of the Explosion object. This event will fire when your specified Explosion object hits a BasePart.

Knowing this, you can Connect() a function that unanchors the touched BasePart at the occurrence of this event.

--[[
    hitPart is the part that was touched by the explosion
    distance is the distance of the part from the explosion
--]]
explosion.Hit:Connect(function(hitPart, distance)
    hitPart.Anchored = false
end)
Ad
Log in to vote
0
Answered by
royee354 129
6 years ago
Edited 6 years ago

https://scriptinghelpers.org/blog/posting-good-questions-and-answers-on-scripting-helpers

You should read that.

Answer this question