Creating and Applying a Force to a Particle Cloud

1. Start by getting a pointer to the particle cloud.

    CreateParticleCloud( "", "Grid" );
    var pcloud = ActiveSceneRoot.FindChild( "", siCloudPrimType );

2. Add a force to the scene using the CreateForce command:

    // Set up a fan on a jaunty angle
    var f = CreateForce( "Fan", pcloud );
    f.posx = -4; f.posy = -1; f.rotz = 37;

3. Apply the force to the particle cloud using the AddParticleForce command:

    AddParticleForce( pcloud, f );

A proxy for the force now appears nested under the particle operator in the scene explorer:

| You can access the force nested under the particle operator by checking for the force’s type among the particle operator’s children. For more information, see Accessing the Emitter Property.