Activating Particle Effect on Collision:

So I have a Particle Effect prefab attached to an object - object contains a Rigid Body and Box Collider. This Particle Effect should play once when it comes in contact with another object with a Collider. I’ve set the Collider on the object as: “Is Trigger”.

This is the script I’ve been working on. I’m obviously missing components but hopefully moving in the right direction:

using UnityEngine;

using System.Collections;

    public class ParticleStarter : MonoBehaviour{

void OnCollisionEnter (Collision col)

{
	if(col.gameObject.other (ParticleEmitter)

	
	   ParticleEmitter.enabled = (true);

	   }

}

Any help would be appreciated.

You need to have a reference to your specific particle system. If the script is on the same game object, the easy way to do it is this. You can also make _psystem public and drag the particle system reference onto it.

[RequireComponent(typeOf(ParticleSystem))]
        
public class ParticleStarter : MonoBehaviour{
            
     private ParticleSystem _psystem;
        
      void Awake() {
          _psystem = GetComponent<ParticleSystem>()
       }
        
       void OnTriggerEnter (Collider col)  {


                 _psystem.Play();
      
        }
        
 }