- Home /
Question by
Somian · Feb 08, 2012 at 05:07 PM ·
javascriptparticles
Change color of Particles per script
Hi, In my game, every player has a different color and I want their gameObject to emit particles that match the player color.
How can I do this via script?
I tried stuff like
var trail=this.GetComponent(ParticleSystem);
trail.particleEmitter.color=gameStatus.Players[playerId].color;
but it doesn't work (color not a member of particleEmitter)
I am using 3.5 beta but if it only works with the old particle system, I can also use this. I just need to know how to change the particle color via script.
Comment