07 / 09
Packages/2D Softbody Pro/Contacts, triggers & events
INTERACTION & CODE
07 / 09

Contacts, triggers & events

Subscribe to body events and understand boundary sensors and collision filtering.

English guideSource: Unity 6000.3.13f1 · Unity Physics 2DWeb edition · 21 October 2026

Subscribe with the owning lifecycle#

Logical collision events aggregate contacts from a body's perimeter nodes. Use physical collision events for contacts, and trigger events when Trigger Mode is enabled.

The following is the guide's contextual subscription fragment. It assumes your component already has a body reference and the ERAGANX.SoftBody2D and UnityEngine imports.

C#
void OnEnable()
{
    body.CollisionEntered += OnBodyCollision;
    body.TriggerEntered += OnBodyTrigger;
}

void OnDisable()
{
    body.CollisionEntered -= OnBodyCollision;
    body.TriggerEntered -= OnBodyTrigger;
}

void OnBodyCollision(SoftBodyContact contact)
{
    Debug.Log($"Contact point: {contact.Point}");
}

void OnBodyTrigger(SoftBodyContact contact)
{
    Debug.Log($"Trigger from: {contact.OtherCollider}");
}

Event families#

FamilyEvents
Physical collisionCollisionEntered, CollisionStayed, CollisionExited
Trigger contactTriggerEntered, TriggerStayed, TriggerExited
Lifecycle and impactInitialized, Impacted, ResetCompleted

SoftBodyContact describes a contributing node/collider pair. Its point and normal are not an averaged contact manifold for the whole soft body.

Boundary sensors and collision filtering#

Trigger colliders are boundary sensors, rather than a filled interior trigger volume. Design detection logic around that perimeter behavior.

Unity's existing layers still govern collision filtering. The optional Collision Mask adds another restriction; the asset does not edit project layer settings for you.

Impact settings#

Collision response comes from Unity Physics 2D contacts. The serialized Impact Strength, Radius and Maximum Compression fields remain for compatibility, but the supplied guide states that they currently do not inject an additional impact kick. Impacted is a thresholded notification.

For an explicit gameplay kick, use the documented force and impulse API with the intended world-space position.

Adapted from the supplied guide · PDF pages 6.View source guide ↗
Keep creating.ERAGAN STUDIO.

Search a topic, setting or method across all package guides.