Drill¶
The drill module enables the developer to set up a Unity GameObject as a drill tool, in order to achieve real time drilling of holes on 3D rigged and static models.
Set up¶
To use the Drill Module, you need to attach the Drill
component onto the gameobject that we want to use as a drill.
Simply click Add Component> MAGES > Mesh Deformations > Drill to add the component.
Note
The scale of the gameObject that this script is attached to, affects the scaling of the drill area.
This gives you the following properties:
Parallel Computation:
Option to run the code in parallel for increased performance.
Local Densing:
Option to split every affected triangle of the drilling into four smaller ones, in order to prevent the smaller diameter holes looking like polygons.
Use Interactable Item
Option to use this script in combination with an interactable item, such that when you have this object in your hand and then press the trigger button a drill is performed.
Drill Area:
Option to set up the drilling axis and the radius of the drill.
Note
Make sure Gizmos are enabled on the Unity editor.
Click the edit button shown in the image below:
Use the handles shown in the scene to adjust the drill area to your requirements as shown below:
That last step that remains is to add a trigger collider component to the gameObject, that is aligned with the drill axis GUI that we created before:
In our example we are going to add a Box Collider
.
Properties¶
Property |
Description |
|
Minimize running times by executing the code in parallel. |
|
Split every affected triangle of the drilling into four smaller ones, in order to prevent the smaller diameter holes looking like polygons. |
|
Set up the drilling axis and the radius of the drill |
|
Called whenever after this script successfully modifies a mesh section. |