Explosion creates an explosion at a world position and reports which Parts were hit.
Available as the global Explosion.
Overview
Methods
- .new(x: number, y: number, z: number, radius: number?) : Explosion
Properties
Events
API
Methods
new
new(x: number, y: number, z: number, radius: number?) : Explosion
Creates an explosion at (x, y, z) and returns the Explosion object.
radius is optional.
Default radius is 8 on Scripts and 5 on LocalScripts.
local boom = Explosion.new(part.Position.X, part.Position.Y, part.Position.Z, 10)
boom.Hit:Connect(function(hitPart, distance)
print(hitPart.Name, "hit at", distance)
end)
Properties
Position
Position readonly : Vector3
World center of the explosion.
Radius
Radius readonly : number
Blast radius used for hit tests.
Events
Hit
Hit : Event (part: Part, distance: number)
Fires once for each Part inside the blast radius.
distance is how far the Part is from the explosion center.
Does not automatically damage players. Handle that in your Hit listener if needed.
