Skip to guide
Rainbow Lab/Documentation

Squish Foundry

Scripting

csharp
using SquishFoundry;
using UnityEngine;

public class SquishPush : MonoBehaviour
{
    public SquishBody body;

    public void Push(Vector3 worldPoint, Vector3 direction)
    {
        body.AddImpulse(worldPoint, direction * 1.5f, 0.4f);
    }
}

Use deformer.Configure(settings) to change response settings. Changing lattice detail rebuilds the cached simulation; ordinary response edits do not. After directly editing weightMap.weights, call RefreshWeights(). A missing map means fully soft; a supplied map with the wrong length pins the mesh rather than applying unrelated data. Call ResetSimulation() after a deliberate pose reset.

Runtime components initialize and simulate automatically while playing. Simulate(deltaTime) is available for explicit editor/test use; do not also call it every frame on an enabled runtime component. SetContactPlane is available for custom collision integration. SquishBody forwards ordinary collision contacts to its child deformers.