A physics-based tornado simulation in Unity that combines linear interpolation, animated pivot rotation, and rigidbody dynamics to create a convincing vortex effect.
The tornado effect emerges from three layered techniques:
- Animated pivot path — An Animator drives a pivot point along a predefined trajectory
- Rotational interpolation — A modified lerp generates a spiraling path around the moving pivot
- Rigidbody interaction — Objects within the trigger volume are pulled in or pushed out based on their distance to the vortex center
The core mechanic uses a custom linear interpolation remap to modulate force direction based on distance. For an object at distance
where
A threshold parameter
where:
-
$\hat{d}$ — unit direction vector from object to vortex center -
$F_c$ — centripetal force strength -
$F_p$ — push (counter) force -
$m$ — force multiplier -
$r$ — reverse indication threshold (default:$0.8$ )
This creates a pull-push cycle: objects accelerate toward the center, then get ejected outward once they cross the threshold — producing the characteristic spiraling motion of a tornado.
| Parameter | Description | Default |
|---|---|---|
centripetalForce |
Inward pull strength | 10 |
push |
Outward counter-force | 3 |
forceMultiplier |
Global force scalar | 10 |
reverseIndicationValue |
Distance threshold for direction flip | 0.8 |
- Play Mode — Click the white square buttons to spawn objects into the scene
- Observe — Watch the rigidbodies interact with the vortex field
- Unity — Game engine and physics (Rigidbody, Trigger Colliders)
- C# — Custom interpolation and force calculations
- Animator — Pivot path animation