Rigidbody.AddExplosionForce(number explosionForce, Vector3 explosionPosition, number explosionRadius, number upwardsModifier = 0, ForceMode mode = ForceMode.Force)
Applies a force to a rigidbody that simulates explosion effects.
Parameters:
Name | Type | Description |
---|---|---|
explosionForce | number | The force of the explosion (which may be modified by distance). |
explosionPosition | Vector3 | The centre of the sphere within which the explosion has its effect. |
explosionRadius | number | The radius of the sphere within which the explosion has its effect. |
upwardsModifier | number | Adjustment to the apparent position of the explosion to make it seem to lift objects. |
mode | ForceMode | The method used to apply the force to its targets. |
Usage
---@type Rigidbody
local rigidbody;
---@type number
local explosionForce;
---@type Vector3
local explosionPosition;
---@type number
local explosionRadius;
---@type number
local upwardsModifier;
---@type ForceMode
local mode;
rigidbody.AddExplosionForce(explosionForce, explosionPosition, explosionRadius, upwardsModifier, mode)