Experiment with the public coefficient properties to find values that lead to numerically stable simulation, while allowing for a pleasing amount of deformation.
My code can be found in the Assets/Scripts/ directory, as *.cs files (ignore *.meta files). I have written this code as a personal project. I’ve tested this project with Unity Editor 2018.2.15f1 on Windows 8.1.
Be aware that displaying gizmos in scenes with many soft bodies may have a noticeable effect on framerate. To view the point mass locations and springs, click the Gizmos button above the Game window to make sure it is highlighted. Then start with the simplest scene, by opening Scenes/OneSlimePrototype, and pressing play. Play in Unity Editorĭownload and open this project with Unity Editor 2018.2.
No animation assets are used in this project, the movement and deformation of the characters is all from the soft body simulation. I’m interested in simple, procedural methods for deforming meshes in response to their collision with other objects, specifically, character meshes made of jelly (slimes!). This is a quick exploration of soft body simulation.