Search Unity

Bug Particle System Trigger module callbacks does not fire

Discussion in 'Scripting' started by HunterAhlquist, Mar 12, 2023.

  1. HunterAhlquist

    HunterAhlquist

    Joined:
    Oct 6, 2013
    Posts:
    132
    Using the exact script from the docs: Unity - Scripting API: MonoBehaviour.OnParticleTrigger() (unity3d.com)
    I am unable to get OnParticleTrigger to fire.
    Here's my setup:
    upload_2023-3-11_17-13-18.png
    Made all events callback to make sure.
    The physics layer of the system is "Default" and the ceiling is "Default" I have made sure they should collide.
    I set a breakpoint to the OnParticleTrigger method of the TriggerScript script, but it never fires.

    Am I misunderstanding what this is for, or is this a bug?
     
  2. QuinnWinters

    QuinnWinters

    Joined:
    Dec 31, 2013
    Posts:
    494
    Use the + button above the callbacks to add colliders that the trigger is allowed to interact with.

    This is the part of the documentation that talks about it:

    "To begin, specify which Colliders in the Scene the particles can interact with. To do this, assign one or more Colliders to the Colliders list property. To increase the number of Colliders in the list, click the Add (+) button beneath the list of Colliders. To remove a Collider from the list, select the Collider and click the Remove (-) button. If you have not yet assigned a Collider to an index of the list, you can use the smaller Add (+) button, to the right of the empty entry, to create and assign a new Collider. This creates a new GameObject as a child of the Particle System and attaches a Sphere Collider to it, then assigns the Collider to the empty entry.

    After you add the Colliders, you can then specify what a particle does when it meets the criteria for passing a particular trigger event type. There are four event types that describe how a particle can interact with a Collider. They are:"

    https://docs.unity3d.com/Manual/PartSysTriggersModule.html