Is it possible for explosions to unanchor parts? Please let me know, any help is appreciated!
1 Like
When you run the explosion, check which parts are within your range. Iterate through all parts that are relevant, claculate their distance like this, and then check if the distance is smaller than the range. If it’s within range, simply set Anchored to false.
local range = 10 --your range in studs
local distanceFromExplosion = (explosion.Position - part.Position).magnitude
if distanceFromExplosion < range then
part.Anchored = false
end
Hmm, seems like it doesn’t work. There are no errors or anything.
create a part called Explosion and use workspace:GetPartsInPart()
So like, create a part called “Explosion” and create the actual explosion in it?
I feel like workspace:GetPartBoundsInRadius()
would be useful here.
Documentation: WorldRoot | Roblox Creator Documentation
You can get parts using explosion.Hit
An example would be
explosion.Hit:Connect(function(part, distance)
part.Anchored = false
end)
1 Like