Skip to main content

Breaking and cutting

A softbody tears when its joints break. Every physics step each joint is checked against the selected criterion, at most Max Breaks Per Step breaking per step. The texture splits along a broken joint, so the tear is visible.

Break mode

Only one criterion is ever active, chosen with Break Mode; the inspector hides the settings of the other modes.

Distance mode

Break Distance Ratio: a joint breaks once its bodies are pulled this many times further apart than they were generated (0 disables). Works on any physics engine, but only sees joints that actually stretch: a chunk dragged away as a unit never stretches its own joints.

Force mode

Break Force and Break Torque: a joint breaks once the force the solver applies to hold it exceeds the threshold. That is the load it really carries, so it tears where the stress is, including joints that never visibly stretch. Break Smoothing at 0 snaps on a single spike; closer to 1 it needs a sustained pull.

Needs Godot Rapier Physics

Godot's physics server does not expose joint reaction forces. Force mode needs Godot Rapier Physics installed and selected as the 2D physics engine; without it the mode is inert and the node shows a configuration warning. See Physics engines.

To pick a threshold, turn on Joints in Debug Draw: every joint is coloured by its load, red being the highest load seen so far, and set the threshold below the peak you want to survive.

Interior strength

Real tears start at a surface or continue from damage. Interior Strength (default 4) multiplies the threshold for joints between two undamaged interior bodies; joints at the outline or next to damage break at the plain threshold, so tears start at the edge and run inward. 1 treats every joint the same.

Cutting

cut(from, to) removes every joint that crosses the line segment between two global points and returns how many it removed. Use it for blades, lasers and swipe gestures. Whether the cut separates the softbody depends on the line reaching all the way across it.

Pieces

joint_removed fires per removal, get_clusters() returns the connected groups of bodies; see Scripting. A body that loses its last joint is frozen, its shape disabled, and body_detached fires; connect to it and unfreeze the body if you want debris.