¡¡Disclaimer - I’m not the creator of Supersoft - this is for those that struggle with the very limited documentation!!
Hello soft body enthusiasts! This is a tutorial and testing thread for Unity + Supersoft users that wish to implement realistic mesh deformation in their projects.
Supersoft is available here: Supersoft - Jelly Mesh Deform | Modeling | Unity Asset Store
I’m using Unity 2019.4 but it should be similar across all supported versions. Maybe version specific - the very first issue I had was installing the required “Bubblegum SDK”. Installing the package from url failed so I had to install it from disk. If that’s also your case then here’s the download page for the package: jaffajam / Bubblegum / Downloads — Bitbucket
Once you’ve got Supersoft installed, I’d strongly recommend checking out the three demo scenes. Especially the “SoftbodyBalls” scene. When you examine the “Squish Ball” prefab, you’ll see these components:
- Rigidbody
- A (sphere) trigger - inside which the impacts will get detected
- A (sphere) collider
- Softbody (script) - with a list of the nodes that will detect impacts and move accordigly. After clicking “Bake” the list gets automatically updated with all children with “Softbody Node” script.
- Softbody Damper (script) - converts trigger messages into collision messages and feeds them into the Softbody component
The Softbody Node settings are pretty self-explanatory, for the most part. Collection Shape/dimensions/weight curve determines how much the vertices inside the shape get influenced by the node.
The node’s rotation (Z+ axis) determines movement direction on impact.
“Connections” allows to set interdependence between nodes.
So let’s do a super quick setup for a vehicle: Take your car mesh object, add a rigidbody (mass 1000), add a capsule trigger, add a box collider and add both “Softbody” and “Softbody Damper” scripts. Now you can setup your nodes and experiment with node connections.
For example above, the FrontCenter node will push the connected nodes along their movement axis (Z+), so the bonnet node will go up and the wheel arches nodes back/sideways.
Now if you want to deform the mesh collider too, it gets a little tricky. You’ll have to duplicate (or make new ones) your nodes and make those deform the mesh collider. To do this, select the new nodes, switch the inspector to debug mode and assign the meshCollider to the nodes, and set meshFilter to none. Here’s my test setup:
BEWARE: You have to press “Bake” after any changes to the nodes. Pressing “Bake” on the parent softbody object will include grandchildren nodes too - so bake those first (Car_SoftMesh), then deactivate, then bake the parent (Car_SoftCollider).
And don’t forget you need the “Job Manager” prefab in your scene.
I haven’t tested this yet but please do take a look at the “Spaceship Softbody” prefab. It uses the node’s “Fixed Connections” to move compound colliders on impact. Maybe it would be worth it to replace the mesh collider with compound colliders - that would mean much better perf, as runtime mesh collider deformation is quite costly. Something like this:
There’s definitely more to explore, my results after a couple hours trying to figure it out:
Cheers, Soul