Squash & Stretch Kit – Manual
This is the manual for Squash & Stretch Kit.
How It Works
Traditionally, animators use the squash & stretch technique to enhance the sense of motion. Objects are squashed when experiencing sudden impacts, and are stretched when moving at high speed.
SquashAndStretch component that comes with Squash & Stretch Kit is the core part of the package. Simply add it to a game object and you’re good to go (although a once-per-project setup described below might be needed). The component scales the object based on velocity and sudden impacts. It also works with Unity’s built in physics (objects with
The direction of squash & stretch is parallel to the object’s direction of motion (the effect axis). When squashed or stretched, not only is the object’s scale parallel to the effect axis changed, the scale perpendicular to the effect axis is also adjusted accordingly in order to preserve volume. So an object becomes fatter when squashed and thinner when stretched.
Per–Project One–Time Setup (Not Always Needed)
Certain components in Squash & Stretch Kit need to be executed before and after every other script updates. If you have not customized any script execution order in the current project, the default script execution orders that come with these components should be sufficient. However, if you have customized script execution order in the project, please make sure the
SquashAndStretchPostUpdatePump scripts respectively execute before/after every script that procedurally manipulates transforms. This can be done in: Edit > Project Settings > Script Execution Order.
SquashAndStretch component has been added, you can see a list of its parameters in the Inspector menu. This section explains what they mean.
You can also mouse-over a parameter to see a tooltip.
There are three different modes that you can pick from to best suit your needs.
- Immediate – Object and squash & stretch effect immediately reflect transform position. Good for objects with mostly smooth position updates while immediate position reflection is desired, such as physically simulated objects.
- Spring – Object springs behind transform position. Good for when objects stretching past original frontal boundary is undesired. Rate at which spring effect wears off is governed by spring half life.
- Smooth Immediate – Object position works like immediate mode, squash & stretch effect works like spring mode, and squash & stretch direction is smoothed.Good for objects with potentially jittery movement that could result in visually popping artifacts in immediate mode.
If squash is enabled, the max squash scale defines the maximum scale in the direction perpendicular to the effect axis. Actual max squash scale is this value or maximum stretch scale reached before squash, whichever is lower. Rate at which squash effect wears off is governed by spring half life.
If stretch is enabled, the max stretch scale defines the maximum scale in the direction parallel to the effect axis. Actual stretch scale applied depends on min/max speed thresholds (see below).
Spring Half Life
Anything using the underlying numeric spring simulator depends on this value. Spring half life is the duration (in seconds) over which the spring effect is reduced to 50%. Multiplying the half life by 10 gives roughly the time for spring effect to reduce to 0.1% (1/1024 to be exact). If you’re ever lost, 0.015 is a good value to start tweaking and experimenting from.
Half-life parameterization eliminates the need to guestimate spring constants. Who knows what a spring constant of 1.37 look like anyway!
Min/Max Speed Thresholds
An object begins to stretch as it goes faster than the min speed threshold. The stretch amount is capped at max stretch scale when the object travels at or faster than the max speed threshold.