- Home /
How to adjust particle system (or Dust Storm if possible) properties from script?
Hello, community! Need help.
I have a model, imported from blender, and need to do fog effect for it. I decided to use either re-adjusted Dust Storm or particle system, but I need to reconfigure it from script, not from inspectpr.
As we know, it is possible to configure particle system via Inspector, but I'm struggling to do the same from script.
Maybe I attach script to a wrong object, passing or not passing necessary public variable, incorectly working with properties, but so far only Destroy(passed_Dust_Storm/particle system); worked for me.
I've attached Dust Storm to my imported model, so that it's now its child element, and somehow need to configure this Dust Storm or particle system (if it is impossible for Dust Storm) in order for it to be similar to a fog. I've done this by Inspector for Dust Storm, but can't from script.
Help please by giving any guidelines and examples of changing such properties (available for change via Inspector) as mix-max emission etc. That is, all those inspector fields, but from script... TO what object should I attach it? What object should I instantiate/pass to the script? What fields of that object correspond to those Inspector fields?
Just can't figure out quickly what I need: particle emmitter, particle system or GameObject.Component<...>... Help please with simple example!
Answer by hexagonius · Dec 09, 2014 at 03:45 PM
Looking up the Scripting API would be your best chance to find the right component. My guess is, that it is the ParticleSystem:
And if you can access it by shortcut depends on if monobehaviour can, and yes it can:
Your answer
![](https://koobas.hobune.stream/wayback/20220613173621im_/https://answers.unity.com/themes/thub/images/avi.jpg)