# AllocateTempMesh(int, int, out NativeSlice<Vertex>, out NativeSlice<ushort>)

> Allocates the specified number of vertices and indices from a temporary allocator.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.5/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## AllocateTempMesh(int, int, NativeSlice\<Vertex>, NativeSlice\<ushort>)

```csharp
public void AllocateTempMesh(int vertexCount, int indexCount, out NativeSlice<Vertex> vertices, out NativeSlice<ushort> indices)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of vertices to allocate, with a maximum limit of 65535 (or UInt16.MaxValue).**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of triangle list indices to allocate, where every three indices represent one triangle. Therefore, this value should always be a multiple of three.**** (\[NativeSlice\<Vertex>]\(/engine/6000.5/script-reference/unity/collections/nativeslice1)): The returned vertices.**** (\[NativeSlice\<ushort>]\(/engine/6000.5/script-reference/unity/collections/nativeslice1)): The returned indices.

### Remarks

You can only call this method during the mesh generation phase of the panel and shouldn't use it beyond.
