- Unity version 2020.3 or higher.
- Launch Unity and open your project.
- In the hierarchy, select
Create -> 3D Object -> Sphere
to instantiate a standard sphere prefab. - With the sphere selected, add the
DemoMeshDeformer
andRigidbody
components 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
FreeCamera
andBallThrow
components to it. - Within the
BallThrow
component settings, assign the previously created sphere prefab.
- Position the object you intend to deform within the scene.
- Apply the
DeformableMesh
script to this object. - Should you require updating the
Mesh Collider
, activate the relevant option in theDeformableMesh
component.
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.