Warning on Setting Particle System Variable

I’m getting the following warning:

BCW0006: WARNING: Assignment to temporary.

On this code:

var gSteam: ParticleSystem; 
gSteam.emission.rate.constant = 6;

Why would setting a particle system’s emission variable be flagged as a temporary assignment?

The constant property/field of rate is actually a struct of type MinMaxCurve named constant. Structs are copies and need to be set by passing a new struct, it is not a reference like classes offer you to keep it simplistic. Vector3 is also a struct but Unity while building the code out does the heavy lifting behind the curtains for you with unityscript/javascript, whereas with c# you have to fullly create a new Vector3 to set say the position of a GameObject. My suggestion is to pass the struct copy into a MinMaxCurve variable, change the constant field and apply it to the constant value.

var gSteam: ParticleSystem; 

var tempMMC: MinMaxCurve = gSteam.emission.rate.constant;
tempMMC.constant = 6;
gStream.emission.rate.constant = tempMMC;

if you don’t care about what the other values are you can just pass a new MinMaxCurve and the first parameter is the constant.

 gSteam.emission.rate.constant = new MinMaxCurve(6);