Is there anyway to automatically anchor a part if it becomes unanchored?

I have a bomb that un-anchors the parts it touches, but there are some parts that I want to stay anchored even if they are hit by the explosion. Is there anyway to automatically re-anchor a part if it becomes unanchored?

I tried the obvious,

if part.Anchored = false then part.Anchored = true

but this did not work. The part still moves with the explosion. Any other thoughts on how to do this?

Use GetPropertyChangedSignal.

part:GetPropertyChangedSignal("Anchored"):Connect(function()
    part.Anchored = true
end)
1 Like

Try this add a script in the parts you want to stay anchored

local part = script.Parent

part:GetPropertyChangedSignal("Anchored"):Connect(function()
    part.Anchored = true
end