Custom part doesn't visualize the explosion.BlastRadius correctly

Hello everyone,

I’m making a custom explosion using the Explosion instance and it mostly worked well. However, when I use a part to visualize where the explosion is at it doesn’t actually cover the full range as show in the picture below:


as you can see the visualizer is nowhere near the part (the small one on the right) yet the explosion detected it.

here is how I create the visualizer:

local Radius = 100
local Explosion = Instance.new("Explosion")
	local BombPart = Instance.new("Part")
	BombPart.Size = Vector3.new(1,1,1)
	BombPart.Shape = Enum.PartType.Ball
	BombPart.Anchored = true
	BombPart.CanCollide = false
	BombPart.CanTouch = false
	BombPart.CanQuery = false
	BombPart.Color = Color3.fromRGB(0,0,0)
	BombPart.Material = Enum.Material.ForceField
	BombPart.Position = Part.Position
	
	
	Explosion.BlastRadius  = Radius
	Explosion.Position = Part.Position
	Explosion.Visible = false
	Explosion.DestroyJointRadiusPercent = 0
	Explosion.BlastPressure = 0
	BombPart.Parent = workspace
	Explosion.Hit:Connect(function(hit)
		print(hit)
	end)
	
	local Tween = TweenService:Create(BombPart,TweenInfo.new(1),{Size = BombPart.Size * Vector3.new(Radius,Radius,Radius)})
	

	Explosion.Parent = workspace
	Tween:Play()

Thank you.

1 Like

I believe that the Explosion is using the Radius as the distance from its position, so the size of the Explosion is actually 200 studs. So maybe try making the size of the BombPart twice as big.
(Just doing Radius * 2 in the tween properties.)

Edit:
I just thought of something to make the properties a little cleaner

--Instead of
{Size = BombPart.Size * Vector3.new(Radius*2,Radius*2,Radius*2)}
-- You can do
{Size = BombPart.Size * (Vector3.one*Radius*2)}

Enjoy!

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.