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.
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#
| Family | Events |
|---|---|
| Physical collision | CollisionEntered, CollisionStayed, CollisionExited |
| Trigger contact | TriggerEntered, TriggerStayed, TriggerExited |
| Lifecycle and impact | Initialized, 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.