- Unity version 2020.3 or higher.
- Launch Unity and open your project.
- In the hierarchy, select
Create -> 3D Object -> Sphereto instantiate a standard sphere prefab. - With the sphere selected, add the
DemoMeshDeformerandRigidbodycomponents via the inspector. - Drag the configured sphere from the hierarchy into your project's Assets folder to create a prefab.
- Locate the main camera within the hierarchy (commonly labeled
Main Camera). - Attach the
FreeCameraandBallThrowcomponents to it. - Within the
BallThrowcomponent settings, assign the previously created sphere prefab.
- Position the object you intend to deform within the scene.
- Apply the
DeformableMeshscript to this object. - Should you require updating the
Mesh Collider, activate the relevant option in theDeformableMeshcomponent.
Make certain that the model designated for deformation has the Read/Write Enabled property activated in its import settings. This adjustment permits the DeformableMesh script to alter the object's mesh dynamically.