|
For several parameters, Shuriken is giving different ways to affect it in the editor : constant, curve, random, gradient etc. However, by script you can only affect a constant value, like for instance : Is there some secret ninjas ways to do that, or do I need to do every frames : As we are talking, among other things, about Shuriken's random stuff, here is an interesting paper (unrelated to the issue here, and yet kind of, as the result above won't be similar to the builtin one, because the random value is re-sampled, thus not connected). ----------
(comments are locked)
|
|
Shuriken is a curiously dark box when looked at from a scripting perspective -- there are many parameters you can manipulate in the editor that are not accessible from script, even things as simple as the size of the emitter. The best Secret Ninja Sauce(TM) I've found is to use the editor to create an animation that animates a particle system property from a minimum value at the start of the animation to a maximum value at the end of the animation, then from your script you can update the animation state using normalizedTime to select a value between min and max (0 for min, 1 for max). You can get the animation state like this (probably best to do this in Awake or Start) ... And then set your value to (say) halfway between min and max with ... You can set up a bunch of animation states, one for each parameter (or set of parameters) that you want to procedurally control. It's a little indirect, but it does give you scripted control of anything you can see in the Shuriken editor. Yup, that does sound like a good way around. Thanks :)
Jun 23 '12 at 03:07 PM
Berenger
I haven't tried it, but for bonus points it should even be possible to create and add AnimationClips procedurally, for full control.
Jun 24 '12 at 03:18 AM
yoyo
(comments are locked)
|

Bringing that question up, trying my luck ...
Last time, I promess !
I've found the script interface leaves some room for improvement - for example, interpolating a particle system between two states seems difficult. Sorry I can't help you, but want to note that I also struggle with this.
I hope they are going to improve it in further versions, that's probably only the first step.
Any news for this ? (up)