When you create a goal for particles, the particles are attracted to it, similar to the way in which a magnet attracts or repels pieces of metal. With goals, you can create a number of particle effects, such as drops of water forming into a puddle, paint being sprayed over a surface, or butterflies being attracted to the bright colors on some guy who's just passing by.
When a particle is born, it is assigned to a location on the goal object that you have defined, and it evolves towards this location throughout its life. The particles try to reach the position and/or shape of the goal objects. When the particles reach the surface of the goal, their velocity decreases and they "stop." If the goal moves or its surface is deformed, the particles keep on trying to reach the goal's surface.
When you want particle to form a target shape (like filling a volume), that shape can be moving and deforming. In fact, if you deform the goal object, then hide it or make it unrenderable, the particles will take on that shape and make it look as if you're deforming the particles.
Particle goals are part of the overall particle simulation, which means that any particles that are progressing toward a goal can also react to obstacles and forces that are applied to them. In fact, goals act as a force on particles, similar to how the Attract force works. For example, if gravity is pulling particles downwards but their goal is above them, the particles will remain in a static position if both these forces are of the same strength.
Creating goals requires the Move Towards Goal compound. This compound lets you do two things:
Choose the location on the goal object to which the particles are attracted: a random location, a specific position value you define, the closest location, the collision location, or the emit location.
Define how the particles move toward the goal. You can set the particle's velocity, alignment, and orientation.
If you want the particles to move among multiple goals, you can use the Multi Goal Sequencer compound with several instances of the Move Towards Goal compound — see Particles Moving Among Multiple Goals.
Create an object that you want to use as a goal for the particles to move toward.
Create a particle emission — see Creating a Basic Particle Emission.
In the ICE tree's preset manager, click the Task tab and select Particles.
Drag the Move Towards Goal compound from the Goals group into the ICE view.
Plug this compound's Execute output into an Execute port on the Simulation Root node, or a port on the ICETree node.
Plug the goal object's Get data node into the Geometry port of the Move Towards Goal compound.
In the Move Towards Goal property editor, set the parameters in the Goal Definition, Motion Towards Goals, and Goal Reached groups.
To set two goals for particles
You can use two Move Towards Goal compounds with two goals and the If node to have particles move to two goals at once.
Particles split between two goals at the same time.
Create a set of "goal object+Move Towards Goal compound" for each goal that you want the particles to move toward (see the previous section for details).
Drag the If node from the Execution group into the ICE view and plug its Result output into a port on the ICETree node.
In the ICE tree's preset manager, click the Task tab and select Particles.
Drag the Every Nth Particle compound from the Conditionals group and plug its output into the Condition port of the If node.
Open this compound's property editor and set the condition that makes the particles switch. In this example, the value of 2 is set so that every other particle goes to one of two goals.
Plug one of the Move Towards Goal's Execute output into the If True port of the If node, and plug the other's Execute output into the If False port.
Particles Moving Among Multiple Goals
If you want to have particles move from one goal to another, you can create a set of "Move Towards Goal+goal object" nodes, then plug each set into the Multi Goal Sequencer compound.
Particles moving from one goal to another.
To make particles move among multiple goals
Create a particle simulation — see Setting Up Any Type of ICE Particle Emission.
In the ICE tree's preset manager, click the Task tab and select Particles.
Drag the Multi Goal Sequencer compound from the Goals group into the ICE view.
Plug this compound's Execute output into a Port on the ICETree node.
Create a set of "goal object+Move Towards Goal compound" for each goal that you want the particles to move toward (see the previous section for details).
Plug each of the Move Towards Goal compound Execute outputs into an Execute Move Towards Goal port on the Multi Goal Sequencer compound, in the order in which you want the particles to travel (top goal is the one that is reached first).
In the Multi Goal Sequencer property editor, you can set the distance in which the particles need to be to each goal before they go to the next one on the list, and you can choose to cycle through all the goals to create a continuous circuit.
Switching to Other Goals Based on a Condition
You can use the Switch to Next Goal compound with multiple goals, such as if you want to switch from one goal to another based on a certain condition. You can switch to other goals within a state system or with a compound or node that lets you set conditions, such as the small but mighty If node.
The following procedure shows how to use the If node and a Conditional compound.
Every 4th particle emitted switches to the goal on the right.
Set up multiple goals as described in the previous section, Particles Moving Among Multiple Goals.
Drag the If node from the Execution group into the ICE view and plug its Result output into an Execute Each Frame port of the first Move Towards Goal compound.
In the ICE tree's preset manager, click the Task tab and select Particles.
Drag a compound from the Conditionals group and plug its output into the Condition port of the If node. In this example, the Every Nth Particle compound is used, meaning that every nth particle moves to the next goal.
Open this compound's property editor and set the condition that makes the particles switch. In this example, every 4th particle is set as the condition to make the particles switch to the next goal.
Drag the Switch to Next Goal compound from the Goals group into the ICE view.
Plug its Execute output into the If True port of the If node.