How to start particle system with script

Hello everyone,
I am using below script to boost car speed for a fixed duration on trigger enter:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TriggerJumpBoost : MonoBehaviour
{
    public float boostForce = 10;
    public float boostDuration = 1;

    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Car" && other.GetComponent<CarController>())
        {
            StartCoroutine(other.GetComponent<CarController>().I_JumpBoost(boostForce, boostDuration));
        }
    }
}

and it’s working great. Recently I added boost partical system in car and I want to start partical system during “boostDuration”. Please help me on modifying above script to achieve my goal. I am new in scripting and partical system. and please tell me what i need to do behind the script also.

Car spawn on runtime on start of race. Partical system is inside car. There are 2 partical systems inside every car and there are 4 cars.
Thanks.

This is the base about how to do that in code:

public ParticleSystem yourParticleSystem;

void YourMethod()
{
    yourParticleSystem.Play();
]
1 Like

Thank you so much for reply. But problem is not just Starting Particle system. As car spawning on race start I am having problem getting particle systems. So, I am trying to get them by FindWithTag but there are some problems also. I give every particle “Boost” tag. But only one particle is getting with tag, while there are 8 particles total in race(2 particles in each car, total 4 cars). Please read my above post to understand whole situation and my goal. Thanks. :slight_smile: