# CreateArchetype

> Creates an archetype from a set of component types.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

## CreateArchetype(ComponentType\[])

Creates an archetype from a set of component types.

```csharp
[ExcludeFromBurstCompatTesting("Takes managed array")]
public EntityArchetype CreateArchetype(params ComponentType[] types)
```

### Parameters

**** (\[ComponentType\[]]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The component types to include as part of the archetype.

### Returns

| Type                                                                                 | Description                                   |
| ------------------------------------------------------------------------------------ | --------------------------------------------- |
| [EntityArchetype](/engine/7000.0/script-reference/unity/entities/entityarchetype.md) | The EntityArchetype object for the archetype. |

### Remarks

Creates a new archetype in the ECS framework's internal type registry, unless the archetype already exists.

## CreateArchetype(ReadOnlySpan\<ComponentType>)

Creates an archetype from a set of component types.

```csharp
public EntityArchetype CreateArchetype(ReadOnlySpan<ComponentType> types)
```

### Parameters

**** (\[ReadOnlySpan\<ComponentType>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): The component types to include as part of the archetype.

### Returns

| Type                                                                                 | Description                                   |
| ------------------------------------------------------------------------------------ | --------------------------------------------- |
| [EntityArchetype](/engine/7000.0/script-reference/unity/entities/entityarchetype.md) | The EntityArchetype object for the archetype. |

### Remarks

Creates a new archetype in the ECS framework's internal type registry, unless the archetype already exists.

## CreateArchetype(NativeArray\<ComponentType>)

Creates an archetype from a set of component types.

```csharp
public EntityArchetype CreateArchetype(NativeArray<ComponentType> types)
```

### Parameters

**** (\[NativeArray\<ComponentType>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): The component types to include as part of the archetype.

### Returns

| Type                                                                                 | Description                                   |
| ------------------------------------------------------------------------------------ | --------------------------------------------- |
| [EntityArchetype](/engine/7000.0/script-reference/unity/entities/entityarchetype.md) | The EntityArchetype object for the archetype. |

### Remarks

Creates a new archetype in the ECS framework's internal type registry, unless the archetype already exists.
