# This file is automatically generated. Please don't edit it manually. # To submit a bug report on the content, see # https://devforum.roblox.com/c/bug-reports/documentation-issues/72 name: Explosion type: class memory_category: Instances summary: | Applies force to `Class.BasePart|BaseParts` within the explosion's `Class.Explosion.BlastRadius`. Breaks `Class.JointInstance|JointInstances` and `Class.WeldConstraint|WeldConstraints` between parts and kills `Class.Humanoid` characters not protected by a `Class.ForceField`. description: | An Explosion applies force to `Class.BasePart|BaseParts` within the explosion's `Class.Explosion.BlastRadius|BlastRadius`. This force breaks `Class.JointInstance|JointInstances` and `Class.WeldConstraint|WeldConstraints` between parts and kills `Class.Humanoid` characters not protected by a `Class.ForceField`. `Class.Constraint|Constraints` will not be broken by an explosion. If an `Class.Explosion` is parented anywhere in the data model while the experience is running, it immediately sets off and, within a few seconds, it becomes unparented. It is not destroyed with `Class.Instance:Destroy()` in this case, so connections do not get disconnected and the parent is not locked. As with all instances, keeping a strong reference an `Class.Explosion` will prevent it from being garbage collected. Note that an `Class.Explosion` must be a descendant of `Class.Workspace` for the explosion visuals to play and the physical/damaging effects to have an impact. #### Explosion Effects `Class.Humanoid|Humanoids` are killed by explosions, as the explosion breaks the character `Class.Model` neck joint. Parenting a `Class.ForceField` to a model will protect all of its children from the explosion kill effect. If you do not want joints between `Class.BasePart|BaseParts` to be broken, or you want to implement your own formula for damaging `Class.Humanoid|Humanoids`, it's recommended that you set `Class.Explosion.DestroyJointRadiusPercent|DestroyJointRadiusPercent` to 0 and use the `Class.Explosion.Hit|Hit` event to handle the result of the explosion. Explosions can also be configured to damage `Class.Terrain`, creating craters, as configured through the `Class.Explosion.ExplosionType|ExplosionType` property. Note that the effect of an explosion is **not** disrupted by obstacles, meaning that parts/terrain shielded behind other parts/terrain will still be affected. code_samples: - Explosion-Instantiation inherits: - Instance descendants: [] tags: [] deprecation_message: '' properties: - name: Explosion.BlastPressure summary: | Used to determine the amount of force applied to `Class.BasePart|BaseParts` caught in the `Class.Explosion.BlastRadius`. description: | Used to determine the amount of force applied to `Class.BasePart|BaseParts` caught in the `Class.Explosion.BlastRadius`. Currently this level of force applied does not vary based on distance from `Class.Explosion.Position`. Unanchored `BaseParts` will accelerate equally away from the origin regardless of distance provided they are within the blast radius. The blast pressure determines the acceleration of parts due to an explosion. It does not determine the degree to which joints are broken. When `Class.Explosion.DestroyJointRadiusPercent` is equal to 1 all joints between parts in the `Class.Explosion.BlastRadius` will be destroyed provided BlastPressure is greater than 0. The BlastPressure also does not determine the amount of damage given to `Class.Terrain`. Provided BlastPressure is greater than 0 and `Class.Explosion.ExplosionType` isn't set to Enum.ExplosionType.NoCraters the size of the crater created is determined exclusively by the `Class.Explosion.BlastRadius`. Setting BlastPressure to 0 eliminates the effect of the explosion and is useful when developers want to program their own custom behavior for explosions using the `Class.Explosion.Hit` event. code_samples: - Custom-Explosion type: float tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] - name: Explosion.BlastRadius summary: | This property determines the radius of the `Class.Explosion`, in studs. This radius determines the area of effect of the explosion, not the size of the explosion's visuals. description: | This property determines the radius of the `Class.Explosion`, in studs. This property accepts any value between 0 and 100. This radius determines the area of effect of the Explosion, not the size of the Explosion's visuals. The size of the Explosion's visual effect is the same regardless of BlastRadius (even if BlastRadius is 0). `Class.BasePart|BaseParts` within the BlastRadius will be affected by the explosion. Meaning, if `Class.Explosion.BlastPressure` is greater than 0, force will be applied to parts. The degree to which joints are broken within the BlastRadius depends on `Class.Explosion.DestroyJointRadiusPercent`. `Class.Explosion.Hit` will fire for any every `Class.BasePart` within the radius. `Class.BasePart|BaseParts` are considered within `Class.Explosion.BlastRadius` even if they are only partially in range. code_samples: - Explosion-Instantiation type: float tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] - name: Explosion.DestroyJointRadiusPercent summary: | Used to set the proportion of the `Class.Explosion.BlastRadius`, between 0 and 1, within which all joints will be destroyed. Anything outside of this range will only have the `Class.Explosion` force applied to it. description: | Used to set the proportion of the `Class.Explosion.BlastRadius`, between 0 and 1, within which all joints will be destroyed. Anything outside of this range will only have the `Class.Explosion` force applied to it. For example, if `Class.Explosion.BlastRadius` is set to 100 and DestroyJointRadiusPercent is set to 0.5, any joints within a radius of 50 studs would be broken. Any joints between the ranges of 50 and 100 studs wouldn't be destroyed, but the `Class.Explosion` force would still be applied to the `Class.BasePart|BaseParts`. This property allows developers to make `Class.Explosion|Explosions` 'non-lethal' to `Class.Humanoid|Humanoids` by setting DestroyJointRadiusPercent to 0. This means the neck joint will not be broken when characters come into contact with the `Class.Explosion`. code_samples: - Explosion-DestroyJointRadiusPercent - Custom-Explosion type: float tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] - name: Explosion.ExplosionType summary: | This property determines how the `Class.Explosion` will interact with `Class.Terrain`. Used to set if explosions will cause damage to the terrain or not. description: | This property determines how the `Class.Explosion` will interact with `Class.Terrain`. It is an Enum.ExplosionType value and can be set to one of three options. - **NoCraters** - Explosions will not damage Terrain - **Craters** - Explosions will create craters in Terrain - **CratersAndDebris** - Redundant, behaves the same as Craters If ExplosionType is set to create craters in `Class.Terrain`, the radius of the crater will be roughly equal to the `Class.Explosion.BlastRadius`. Craters are created in all `Class.Terrain` materials other than water. The size of the crater is not influenced by the material, although some materials create rougher edges than others. code_samples: - Explosion-ExplosionType type: ExplosionType tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] - name: Explosion.LocalTransparencyModifier summary: '' description: '' code_samples: [] type: float tags: - Hidden - NotReplicated deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: false can_save: false capabilities: [] - name: Explosion.Position summary: | This property is the position of the center of the `Class.Explosion`. It is defined in world-space and not influenced by the `Class.Explosion` parent. description: | This property is the position of the center of the `Class.Explosion`. It is defined in world-space and not influenced by the `Class.Explosion` parent. `Class.BasePart|BaseParts` will be influenced by the `Class.Explosion` if they are within `Class.Explosion.BlastRadius` studs of the explosion's position. The effect of an explosion is instantaneous. This means that although the position of an explosion can be changed after it has been set it cannot affect two different areas. Once an explosion has been 'detonated', shortly after parenting it to a descendant of the `Class.Workspace`, it will not do so again. In some cases the visual effect of the explosion will move but it will have no effect. For this reason a new Explosion should be created if the developer wants an explosion to appear at a different position. code_samples: - Explosion-Instantiation type: Vector3 tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] - name: Explosion.TimeScale summary: | Value between 0 and 1 that controls the speed of the particle effect. description: | A value between 0 and 1 that controls the speed of the particle effect. At 1 it runs at normal speed, at 0.5 it runs at half speed, and at 0 it freezes time. code_samples: [] type: float tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] - name: Explosion.Visible summary: | This property determines whether or not the visual effect of an `Class.Explosion` is shown or not. description: | This property determines whether or not the visual effect of an `Class.Explosion` is shown or not. When Visible is set to false, the explosion will still affect `Class.BasePart|BaseParts` in its `Class.Explosion.BlastRadius`, the only difference is it will not be seen. One use for this property would be for a developer to make their own custom explosion effects using a `Class.ParticleEmitter`, while retaining the default `Class.Explosion` functionality. code_samples: - Explosion-Visible type: boolean tags: [] deprecation_message: '' security: read: None write: None thread_safety: ReadSafe category: Data serialization: can_load: true can_save: true capabilities: [] methods: [] events: - name: Explosion.Hit summary: | Fires when the `Class.Explosion` hits a `Class.BasePart` within its `Class.Explosion.BlastRadius`. Returns the part hit along with the distance of the part from `Class.Explosion.Position`. description: | Fires when the `Class.Explosion` hits a `Class.BasePart` within its `Class.Explosion.BlastRadius`. Returns the part hit along with the distance of the part from `Class.Explosion.Position`. Note that the effect of an `Class.Explosion` is not disrupted by obstacles, this means parts shielded behind other parts will still be hit, even if the `Class.BasePart` they are shielded behind is anchored. This event will also fire when `Class.Explosion.BlastPressure` is equal to zero. This means developers can program their own custom behavior for explosions by eliminating the explosion's influence on `Class.BasePart|BaseParts` and `Class.Terrain`. Note that this event will fire for every `Class.BasePart` hit. This means it can fire multiple times for the same player character (as the character `Class.Model` is made up of multiple parts). For this reason when dealing custom damage using the `Class.Explosion.Hit` event it's recommended to implement a check to see if the character has already been hit by the `Class.Explosion`. code_samples: - Custom-Explosion parameters: - name: part type: BasePart default: summary: | The `Class.BasePart` hit by the `Class.Explosion`. - name: distance type: float default: summary: | The distance of the hit from `Class.Explosion.Position`. tags: [] deprecation_message: '' security: None capabilities: [] callbacks: []