How to change the colour of particles when colliding with a specific object?

Hi all, I have been trying to get this to work all afternoon and it's driving me crazy. can someone tell me how to alter the colour of particles? I have looked at all the script reference stuff which was not very helpful. Heres what I have got so far:

var laserColourGreen: Color = Color(45.0, 255.0, 0.0, 255.0);
var laserColourRed: Color = Color(255.0, 0.0, 0.0, 255.0);

function OnParticleCollision (particle : GameObject) {
    var laserParticles = particleEmitter.particles;
        if (particle.gameObject.tag == "Laser")
        {
            for (var i = 0; i < laserParticles.Length; i++) 
            {
                laserParticles*.color = laserColourRed;*
 *}*
 *}* 
 *else* 
 *{*
 _laserParticles*.color = laserColourGreen;*_
 _*}*_
 _*particleEmitter.particles = laserParticles;*_ 
_*}*_
_*```*_
_*<p>This script is attached to the particleEmitter. Any ideas?</p>*_

You should probably try to access the renderer>material>shader>color or tint color property.

Basically it depends on particles material; if its none or simple one it should work with color property.

Anyway look at the forum thread:

http://forum.unity3d.com/threads/67725-Adjusting-the-Tint-of-a-Particle-Additive-shader

This looks like it should work. http://unity3d.com/support/documentation/ScriptReference/ParticleEmitter-particles.html Are you sure that this function is getting called? Can you add some Debug.Log and/or run in the debugger?