|
Hi, What I have is an Ellipsoid Particle Emitter, Particle Animator, Particle Renderer, and a World Particle Collider (in that order) attached to a prefab that I have named "ParticlePrefab". The ParticlePrefab is attached to my Player GameObject. Everytime I press 'h' on the keyboard, I see particles emit, which is what I want. Now I need to be able to change the color of the particles, through a script. Here is what I have so far:
} If this cannot be done through a script, could someone show me how to use AddComponent so that I can add a particle emitter, of which i will color, the player component and get it to work in the same way?
(comments are locked)
|
|
Here, this will change your colors programatically. I didn't touch much of it so a large part is hard coded like you had it.
But unless there is something wrong with the way you have it, using a prefab is likely faster and easier. The old adage "Why fix something that's not broken." seems fitting here. The definite solution. Thanks =))
May 29 '10 at 08:23 PM
lampshade
(comments are locked)
|
|
I'm having the same problem...... I have particle emitters that i want to change the colour of procedurally (as in to flow through from say green to red over time when i prompt it to) how would I go about doing this?
(comments are locked)
|

Alright so I made a new particle emitter for red particles and just added to a prefab, deleted the system, and added the prefab to my player Game Object and it worked. But I would prefer to change it through code how can I do that?