SetPreBakeCollisionMesh(bool, bool)
Enables or disables pre-baking of collision mesh data during player build for all imported meshes.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
public void SetPreBakeCollisionMesh(bool isConvex, bool preBake)
Parameters
Remarks
This method allows you to control whether convex or triangle collision mesh data should be pre-baked during player build for all the imported meshes of that model. Pre-baked collision mesh data improves runtime performance when the mesh is used with a MeshCollider component.
When collision mesh data is not pre-baked, Unity generates the collision representation at runtime, which may impact performance.
Additional Resources: ModelImporter.HasPreBakeCollisionMesh, MeshCollider.