OnTrigger2DActivator - CodingDino/Dino-Unity-Toolkit GitHub Wiki

The OnTrigger2DActivator component triggers an action whenever a different GameObject collides with the GameObject the component is attached to. Both GameObjects must have a Collider2D of some type attached to them, and at least one of them must have "isTrigger" checked. Extra conditions can be set to only react when certain objects overlap, or to react when the overlapping ends or while it is occurring.

This is an Activator component, and does nothing on its own, instead triggering a linked Action component. Actions, Activators, and Data make up the core system for the Dino Unity Toolkit.

Image: An OnTrigger2DActivator set up to react when a GameObject called "Player" overlaps with it, and disable that object.

Properties

Conditions

These are the conditions which must be met in order for the actions to be triggered.

Property: Description:
Check Name Check this if the activator should only respond if the GameObject overlapping has a specified name.
Target Name The name that the overlapping GameObject must have to trigger this Activator. This must match EXACTLY.
Check Tag Check this if the activator should only respond if the GameObject overlapping has a specified tag.
Target Tag The tag that the overlapping GameObject must have to trigger this Activator. This must match EXACTLY.
Check Layer Check this if the activator should only respond if the GameObject overlapping is on the specified layer.
Target Layer The layer that the overlapping GameObject must be on in order to trigger this Activator. This must match EXACTLY.

Actions

These are the lists of actions that will be activated when the above conditions are met.

Property: Description:
On Collision Enter () Activates when a GameObject meeting the above conditions first overlaps with this GameObject.
On Collision Stay () Activates every frame while a GameObject meeting the above conditions is overlapping with this GameObject.
On Collision Exit () Activates when a GameObject meeting the above conditions stops overlapping this GameObject.