How to use AddForce on a particle?

Hi. In Unity, I am seeking to create a sort of vacuum object that draws in, and deletes particles from a particle system upon collision.

I would only like to apply this force to the particles within a trigger collider’s area.

I would like this to affect every particle system within the scene, even ones that are not created before runtime.

It would be ideal, but not required, to handle everything from a single script.

Any response detailing how I would accomplish this would be appreciated.

I have kind of figured out how I can accomplish this using the code below. It vacuums the particles in greatly, but it won’t destroy them when I set their lifetime to zero.

public float vacuumForce = 5f;
    public float vacuumRadius = 5f;
    public float destructionDist = 0.2f;

    public Collider2D triggerCollider;

    private void Update()
    {
        ParticleSystem[] particleSystems = FindObjectsOfType<ParticleSystem>();

        foreach (ParticleSystem particleSystem in particleSystems)
        {
            ApplyVacuumForceToParticles(particleSystem);
        }
    }

    private void ApplyVacuumForceToParticles(ParticleSystem particleSystem)
    {
        ParticleSystem.Particle[] particles = new ParticleSystem.Particle[particleSystem.main.maxParticles];
        int numParticlesAlive = particleSystem.GetParticles(particles);

        for (int i = 0; i < numParticlesAlive; i++)
        {
            Vector3 particleWorldPosition = particleSystem.transform.TransformPoint(particles[i].position);



            if (triggerCollider.OverlapPoint(particleWorldPosition))
            {
                Vector3 vacuumPosition = transform.position;
                Vector3 directionToVacuum = (vacuumPosition - particleWorldPosition).normalized;
                float distanceToVacuum = Vector2.Distance(vacuumPosition, particleWorldPosition);

                if (distanceToVacuum < vacuumRadius)
                {
                    particles[i].velocity += directionToVacuum * vacuumForce * Time.deltaTime;
                }
                if (distanceToVacuum <= destructionDist)
                {
                    particles[i].remainingLifetime = 0;
                }
            }
        }

        particleSystem.SetParticles(particles, numParticlesAlive);
    }

You don’t really need a script for this. You can use a particle system’s force field component to suck particles towards it and when they collide with the collider that’s on the force field object they can automatically destroy themselves.