# help please particle fx

**URL:** <https://discussions.unity.com/t/help-please-particle-fx/399790>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [October 17, 2009, 11:38pm UTC](https://discussions.unity.com/t/help-please-particle-fx/399790 "2009-10-17T23:38:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon\_25973945](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@anon\_25973945](https://discussions.unity.com/u/anon_25973945)\
**Post date:** [October 17, 2009, 11:38pm UTC](https://discussions.unity.com/t/help-please-particle-fx/399790/1 "2009-10-17T23:38:49Z")

</div>

hi all

can someone please help me with this

i am not a coder at all but i am a kickass artist

i am looking for some help

i have a gameobject that changes color and i want to attach a particle trail to it

the trails’s color will be the gameobject’s current color

so say i have 2 colors blue and red

when gameobject color is blue i want the particle trail color to be blue and when its red i want it to be red

can someone help please

---

<div class="post-metadata">

**Author:** ![anon\_14583612](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@anon\_14583612](https://discussions.unity.com/u/anon_14583612)\
**Post date:** [October 20, 2009, 7:37pm UTC](https://discussions.unity.com/t/help-please-particle-fx/399790/2 "2009-10-20T19:37:33Z")

</div>

ok… i was trying to find a better way to do it, but i couldn’t… so, i guess i can give you this script, just attach it to the particle system that you have:

```auto
var obj : GameObject;

function Update () {
	var allParticles : Particle[] = particleEmitter.particles;
	for (var p : Particle in allParticles) {
		if(p.energy >= particleEmitter.minEnergy) {
			p.color = obj.renderer.material.color;
		}
	}
	
	particleEmitter.particles = allParticles;
}

```

where **obj** is the gameobject that you are using  
hope this helps

---

<div class="post-metadata">

**Author:** ![anon\_14583612](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@anon\_14583612](https://discussions.unity.com/u/anon_14583612)\
**Post date:** [October 20, 2009, 7:40pm UTC](https://discussions.unity.com/t/help-please-particle-fx/399790/3 "2009-10-20T19:40:36Z")

</div>

one more thing:  
for this script to work, the “Does Animate Color?” property has to be turned off (or false) in the ParticalAnimator component for the particle system

---

<div class="post-metadata">

**Author:** ![anon\_14583612](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@anon\_14583612](https://discussions.unity.com/u/anon_14583612)\
**Post date:** [October 21, 2009, 7:51pm UTC](https://discussions.unity.com/t/help-please-particle-fx/399790/4 "2009-10-21T19:51:33Z")

</div>

i have to say i didn’t try the script… but i should work, tell me if it does lol

---

<div class="post-metadata">

**Author:** ![anon\_36592891](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@anon\_36592891](https://discussions.unity.com/u/anon_36592891)\
**Post date:** [October 23, 2009, 4:52pm UTC](https://discussions.unity.com/t/help-please-particle-fx/399790/5 "2009-10-23T16:52:41Z")

</div>

hi spartacus, check this out…[http://www.unifycommunity.com/wiki/index.php?title=OptimizedTrailRenderer](http://www.unifycommunity.com/wiki/index.php?title=OptimizedTrailRenderer)
