Carrying Soft Bodies
Opt-in defaults off; radius defaults 0.15 m, accepts 0.001..10 m and changes only after release. Use the existing Carry profile, not legacy grabber. Selection raycasts deformed physics triangles, respects obstacles/layers and total Soft Body mass, then holds a fixed connected surface neighborhood. Nearby opposite layers are not grabbed through space.
Example#
soft.set_grab_enabled(true);
soft.set_grab_radius(0.15);
// Existing carry.update_controls() remains unchanged.
var type = carry.get_held_type();
var held_soft = carry.get_soft_body();
var count = carry.get_grab_vertex_count();Usage and limits#
Forces move the selected region. Rotation needs at least three suitable non-collinear free vertices. Pins and attachments remain; pinning a held vertex releases capture. Throw adds velocity to the region with the existing speed cap, not one rigid velocity to the entire mesh. Only one grabber holds a Soft Body at once.
get_held_type returns none/body/soft_body. get_body returns undefined for soft objects; use get_soft_body. Holding subdivides the world step to at most 1/240 s, or 1/480 s with dynamic attachments, capped at 64 segments. Detailed visuals are not separate hit surfaces. Disabling grab or destroying the object safely releases.
API reference#
Public function and method signatures. Call methods on the returned instance; parameters with defaults are optional.
Related guides#
- Migrating existing code
- Choosing a Soft Body
- Soft sphere
- Volumetric soft box
- Closed model import
- Cloth model and named anchors
- Spatial attachments
- Separate visual mesh
- Local force and impulse
- Wind
Verified operation contracts#
These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.
| Symbol / owner | Signature | Operation contract |
|---|---|---|
| JoltBBMODBox.get_grab_enabled | JoltBBMODBox.get_grab_enabled() | Boolean native setting; also false for an invalid object. |
| JoltBBMODBox.get_grab_radius | JoltBBMODBox.get_grab_radius() | Selection radius in metres; undefined for an invalid wrapper. Inspect native errors separately. Default radius 0.15 m. |
| JoltBBMODBox.set_grab_enabled | JoltBBMODBox.set_grab_enabled(enabled) | Boolean or 0/1; returns Boolean success. Controls soft-body Grabber eligibility, not climbing Grip. Default false. |
| JoltBBMODBox.set_grab_radius | JoltBBMODBox.set_grab_radius(radius) | Finite radius 0.001..10 m; Boolean. Defines local particle selection when grabbing; release the held object before changing it. Default radius 0.15 m. |
| JoltBBMODCloth.get_grab_enabled | JoltBBMODCloth.get_grab_enabled() | Boolean native setting; also false for an invalid object. |
| JoltBBMODCloth.get_grab_radius | JoltBBMODCloth.get_grab_radius() | Selection radius in metres; undefined for an invalid wrapper. Inspect native errors separately. Default radius 0.15 m. |
| JoltBBMODCloth.set_grab_enabled | JoltBBMODCloth.set_grab_enabled(enabled) | Boolean or 0/1; returns Boolean success. Controls soft-body Grabber eligibility, not climbing Grip. Default false. |
| JoltBBMODCloth.set_grab_radius | JoltBBMODCloth.set_grab_radius(radius) | Finite radius 0.001..10 m; Boolean. Defines local particle selection when grabbing; release the held object before changing it. Default radius 0.15 m. |
| JoltBBMODModel.get_grab_enabled | JoltBBMODModel.get_grab_enabled() | Boolean native setting; also false for an invalid object. |
| JoltBBMODModel.get_grab_radius | JoltBBMODModel.get_grab_radius() | Selection radius in metres; undefined for an invalid wrapper. Inspect native errors separately. Default radius 0.15 m. |
| JoltBBMODModel.set_grab_enabled | JoltBBMODModel.set_grab_enabled(enabled) | Boolean or 0/1; returns Boolean success. Controls soft-body Grabber eligibility, not climbing Grip. Default false. |
| JoltBBMODModel.set_grab_radius | JoltBBMODModel.set_grab_radius(radius) | Finite radius 0.001..10 m; Boolean. Defines local particle selection when grabbing; release the held object before changing it. Default radius 0.15 m. |
| JoltBBMODSoftBody.get_grab_enabled | JoltBBMODSoftBody.get_grab_enabled() | Boolean native setting; also false for an invalid object. |
| JoltBBMODSoftBody.get_grab_radius | JoltBBMODSoftBody.get_grab_radius() | Selection radius in metres; undefined for an invalid wrapper. Inspect native errors separately. Default radius 0.15 m. |
| JoltBBMODSoftBody.set_grab_enabled | JoltBBMODSoftBody.set_grab_enabled(enabled) | Boolean or 0/1; returns Boolean success. Controls soft-body Grabber eligibility, not climbing Grip. Default false. |
| JoltBBMODSoftBody.set_grab_radius | JoltBBMODSoftBody.set_grab_radius(radius) | Finite radius 0.001..10 m; Boolean. Defines local particle selection when grabbing; release the held object before changing it. Default radius 0.15 m. |
| JoltBBMODSphere.get_grab_enabled | JoltBBMODSphere.get_grab_enabled() | Boolean native setting; also false for an invalid object. |
| JoltBBMODSphere.get_grab_radius | JoltBBMODSphere.get_grab_radius() | Selection radius in metres; undefined for an invalid wrapper. Inspect native errors separately. Default radius 0.15 m. |
| JoltBBMODSphere.set_grab_enabled | JoltBBMODSphere.set_grab_enabled(enabled) | Boolean or 0/1; returns Boolean success. Controls soft-body Grabber eligibility, not climbing Grip. Default false. |
| JoltBBMODSphere.set_grab_radius | JoltBBMODSphere.set_grab_radius(radius) | Finite radius 0.001..10 m; Boolean. Defines local particle selection when grabbing; release the held object before changing it. Default radius 0.15 m. |