EXPRESIONS
If




In this Tutorial you can see how we can control the emitter`s emsion speed using a Derived Variable from another one.

We have created a pair of emitters: Circle01 and Square01. What we want is Square01 to emit only when the Circle01 is below it.
Square01 is not moving while Circle01 has a sinusoidal up and down movement.
The If stament is located at the Expresions tab in the curve editor, below the ternary functions button.



The if statement sintaxis is as follows:

- if(circle01.position_y<square01.position_y,4,0)

In natural languaje it can be read as:

IF the Y position of Circle01 is lower than the Y position of Square01
THEN the Active channel value (speed of Square01 in this chase) is 4
ELSE (Y position of Circle01 is higher than the Y position of Square01) the Active channel value is 0

This expresion must be set up in the Speed channel of square01

Try moving up and down the Square01 emitter or crate diferents animations for each emittr an see results.

There is noise daemon linked to circle01 to add drama to the emitter :)