Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsWorld.ExplosionDefinition

Used to define the parameters when using PhysicsWorld.Explode.
Read time 1 minuteLast updated 13 days ago

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsWorld.ExplosionDefinition

Static Fields

Value

Description

MaxImpulseThe maximum magnitude allowed for _impulsePerLength. Larger magnitudes have no useful effect because body speeds are capped each simulation step, so values are clamped into this range.

Constructors

Constructor

Description

ExplosionDefinition()Create a default explode definition.

Properties

Property

Description

falloffThe falloff distance beyond the radius. Impulse is reduced to zero at this distance.
hitCategoriesThe categories that will produce hits.
impulsePerLengthImpulse per unit length. This applies an impulse according to the shape perimeter that is facing the explosion. Explosions only apply to circles, capsules, and polygons. This may be negative for implosions. The magnitude is clamped to PhysicsWorld.ExplosionDefinition.MaxImpulse.
positionThe center of the explosion in world space.
radiusThe radius of the explosion.

Static Properties

Property

Description

defaultDefinitionCreate a default explode definition.