Skip to content

PhysicsBodyComponent.IsTrigger Property

When true, this body acts as a sensor: it reports overlaps via OnTriggerEnter / OnTriggerStay / OnTriggerExit but generates no collision response forces.

public bool IsTrigger { get; set; }

Property Value

System.Boolean

Exceptions

System.InvalidOperationException
Thrown when setting to true while Shape is a ChainShape.

Remarks

Box2D only generates sensor events when a sensor shape overlaps a \<em>non-sensor\</em> shape. Two bodies that both have IsTrigger = true will not fire trigger events with each other.