control particles with variables

Hello, sorry if this is a real noob question, but searched the forums for a bit and couldn’t find anything: I have a very simple scene with just like 4 particle emitters. I would like to control some of the parameters of the emitters with variables (either set as constants or perhaps in response to a timer or control input or etc). Where do I “attach” such a control script? There are no objects in my scene other than the camera and the particle emitters - so if I want, for example, a global variable ‘ellipsoidX’ to adjust the value of the (ahem) ellipsoid X parameter for all of the particle emitters…?

Thanks in advance for any advice (even "go dig through the docs here type of advice will be greatly appreciated!).

You could simply create an empty game object and call it “ParticleController” or whatever, then attach whatever script(s) you have to that.

The script might have four variables such as …

var Emitter1 : GameObject;

that can then be identified by dragging them onto the spots that appear for the variables in the Inspector.

Then you can add you functions specific to each emitter.

I think most around here commonly use an empty GameController object with script attached that is in the first scene of a game and has a DoNotDestroy on level load line of code so it persists throughout all your game’s scenes.

In my case, this holds the functions to load levels when a button is pressed, as well as global variables I want to access throughout the game.

Ah, awesome, thanks DaveyJJ! I’ll reserve a seat for you at Powell’s :slight_smile: