Force zones

In Obi, any collider can become a force zone. Particles inside the force zone will be applied force, acceleration or wind in the direction specified by the zone's type. They can also be used to modify the lifetime of emitted particles that go inside of them.

You can use force zones for many different things: as a tool to manipulate particles, to create wind effects, or even to cheaply simulate underwater behavior.

Helix-shaped distance field acting as a radial force zone on granular particles.
A capsule-shaped force zone placed in front of the fan is used to apply wind to smoke and cloth.
Rope falling into a pool simulated using a box-shaped force zone that applies an upwards force proportional to depth, as well as some damping.

Setting up force zones

Add a ObiForceZone component to any ObiCollider in your scene to turn it into a force zone. The collider will now allow particles to go inside of it and be affected by the force zone.

This is how the ObiForceZone component inspector looks like:


Type

There's 4 types of force zones:

Directional:
A directional force zone will move particles in the collider's forward-facing direction: its local positive Z axis.

Radial:
A radial force zone will move particles towards the surface of the collider..

Vortex:
A vortical force zone will move particles in the direction orthogonal to the particle's velocity and the vector towards the surface of the collider.
Void:
A void force zone is slightly special, in that it won't change the velocity of particles: instead, it modifies their lifetime, which is useful for killing fluid or granular particles. To reduce the lifetime of particles, use a positive intensity. Using a negative intensity is also possible, this will extend the particle's lifetime.

Mode

There's 3 different ways for force zones to affect particles:

Force:
A mass-weighted acceleration. Given a force of the same intensity, heavy particles will be less affected than lighter particles.

Acceleration:
Change in velocity. All particles will be equally affected by an acceleration, regardless of their mass.

Wind:
Certain ObiActors (currently, Cloth, Fluids and Ropes/Rods) respond to wind forces, taking into account aerodynamic properties. Cloth and ropes will wave/undulate in the presence of wind, and the surface of fluids will be affected by drag if they have non-zero atmospheric drag.

Intensity

Intensity of the force/acceleration/wind inside this force zone. Negative values can be used, which will invert the direction of the force: directional zones with negative intensity will move particles towards the collider's back-facing direction (negative Z axis) and radial force zones with negative intensity will move particles away from the surface of the collider. In case of void zones, positive intensities will reduce the particle's lifetime while negative intensities will increase it.

Damping direction

Direction of the damping force applied to particles inside the force zone. It can be in the same direction as the force applied by the force zone, or in the direction towards the surface of the force zone.

Damping

Strength of the damping force applied to particles inside the force zone.

Falloff Min Distance

Distance from the surface of the force zone at which the intensity is fully affected by falloff, and hence zero.

Falloff Max Distance

Distance from the surface of the force zone at which intensity is not affected by falloff.

Falloff

How fast the force zone intensity decays from max distance to min distance (see above).

Tint color

Particles inside the force zone will be tinted this color. Tinting speed is controlled by the color's alpha value, and also modulated by the zone's falloff.

Pulse Intensity

How much the force zone intensity randomly changes over time.

Pulse Frequency

How fast the force zone intensity randomly changes over time.

Pulse Seed

Seed for pulse random number generation.