I wrote a system for dropping unanchored parts into a container, and then allowing the player to create an explosion inside of that container to make the parts fly out of it.
The first few explosions work as intended, but then it breaks and the parts no longer get flung.
I’d have to imagine the issue is related to setting the blastpressure to 0 on the client, which is purposeful (I don’t want players getting flung, only the unanchored meshes).
Found a solution using Explosion.Hit, but am still looking for any other solutions that may be better.
local function createExplosion()
local explosion = Instance.new("Explosion")
explosion.BlastPressure = 3000000
explosion.DestroyJointRadiusPercent = 0
explosion.BlastRadius = 200
explosion.Position = workspace.ExplosionPart.Position
explosion.Visible = false
local alreadyHit = {}
explosion.Hit:Connect(function(part, distance)
local model = part.Parent
if model then
if alreadyHit[model] then
return
end
alreadyHit[model] = true
local humanoid = model:FindFirstChild("Humanoid")
if humanoid then
model.HumanoidRootPart.Anchored = true
task.wait(.1)
model.HumanoidRootPart.Anchored = false
end
end
end)
explosion.Parent = workspace
end