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
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:
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
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
i have to say i didn’t try the script… but i should work, tell me if it does lol