*help* particle trigger script

super noob here

I’ve been searching for hours on how to create a particle trigger script online, although I’ve found many examples none of them seem to work.

all i want to do is have an item trigger a particle emitter that I’ve created. when it comes to programming i have 0 experience and I’m basically learning as i go. I’ve copied bits and pieces of codes from here and there and feel that i have started the script correctly but its not working. how do i reference the particle prefab that i have created to the trigger?

does seem right to anyone? do i have to include a tag in the script since its supposed to interact with an enemy.

#pragma strict

var freezeCloud: ParticleEmitter;

function Start ()

{

}

function OnTriggerEnter(freezeCloud:Collider){
particleEmitter.emit=true;

}

function OnTriggerExit(freezeCloud:Collider){
particleEmitter.emit=false;

}

particleEmitter is the legacy system
http://docs.unity3d.com/Documentation/ScriptReference/ParticleEmitter.html
If you are using/want to use shuriken particles, you need particleSystem
Unity - Scripting API: ParticleSystem

Using tags is not exactly required, but if you only want enemies to trigger the effect then you will need some way to identify what has entered the trigger.
In your script (please use code tags) you dont want to use freezeCloud in the OnTrigger function, change that to something else (eg. “other”) because it is an ‘other’ object that is triggering the particles. Then you need to use the refernce you create at the top.

#pragma strict

var freezeCloud: ParticleEmitter;

function OnTriggerEnter(other : Collider){
  freezeCloud.emit=true;
}

function OnTriggerExit(other : Collider){
  freezeCloud.emit=false;
}