{{description>Create Meshes from volumes. Combine, unwrap UV2 coordinates, add colliders & more for visually impressive game development.}}
====== Create Mesh ======
This component is used in example scene(s) such as:
12_Train, 21_CGExtrusion, 23_CGTube.
Takes one or more [[..:datatypes#VMesh|VMeshes]] and creates Unity meshes from them. If no Spots input is connected, all meshes are created at the generator's origin. If Spots are connected, meshes are instantiated at each spot's position.
===== Slots =====
==== Inputs ====
^ Name ^ Type ^ Description ^
| VMesh[] | Array of [[..:datatypes#VMesh|VMesh]] | The mesh data to turn into Unity meshes |
| Spots | [[..:datatypes#Spots|Spots]] | (Optional) Placement spots; when connected, one mesh is created per spot |
===== Settings =====
==== General ====
Basic mesh creation options.
=== Combine ===
When enabled, all input meshes are merged into a single Unity mesh.
=== Unwrap UV2 ===
//(Requires the Combine setting)//
When combining meshes, UV2 coordinates are kept as-is by default. Enable this to recompute them by unwrapping the combined mesh.
This operation is Editor-only (not available in builds) and is CPU intensive.
=== Group Meshes ===
//(Requires the Combine setting and the Spots input)//
When enabled, only meshes sharing the same VMesh index are combined together.
Meshes from the [[.:deformmesh|Deform Mesh]] module do not share indices and will not be grouped.
=== Include Normals ===
When enabled, normals are included in the generated mesh.
=== Include Tangents ===
When enabled, tangents are included in the generated mesh.
=== Make Static ===
When enabled, generated GameObjects are flagged as [[http://docs.unity3d.com/Manual/StaticObjects.html|Static]].
In Play Mode with Make Static enabled, mesh generation is paused to avoid overriding Unity's static mesh optimizations.
=== Layer ===
The layer assigned to the generated GameObjects.
=== Tag ===
The tag assigned to the generated GameObjects.
==== Renderer ====
Options matching Unity's MeshRenderer component. All standard MeshRenderer settings are available, plus:
=== Renderer Enabled ===
When set to false, the mesh is created without an enabled renderer. Useful when generating a mesh for collision purposes only, with no visual output needed.
==== Collider ====
Defines the type of collider added to each generated mesh.
=== Convex ===
//(Mesh Collider only)//
Creates a convex MeshCollider instead of a concave one.
=== Trigger ===
When enabled, the collider is treated as a trigger (no physics response, events only).
=== Auto Update Colliders ===
When enabled, MeshColliders automatically refresh when the mesh changes.
=== Cooking Options ===
Options used during collider mesh baking.
This setting can heavily impact performance. See [[documentation:performancetips#allow_parallel_mesh_baking|Allow Parallel Mesh Baking]] for details.
=== Material ===
The physics material assigned to the MeshCollider.
==== Export ====
Options for saving generated meshes outside the generator for use in prefabs or asset workflows.
=== Save To Scene ===
Creates a GameObject outside the generator hierarchy containing a copy of the generated mesh(es).
Due to a Unity change, meshes saved this way may appear as null when the object is made into a prefab. Use **Save To Both** instead to avoid this.
=== Save To Assets ===
Saves a copy of the generated mesh(es) as project asset files.
=== Save To Both ===
Saves mesh(es) as assets, then creates a GameObject referencing those assets. The resulting GameObject can safely be turned into a prefab.