# Physics Layers

Airship reserves layers 0-16 for internal use. Every other layer is available for use by game devs.

These layers are named GameLayer\[0-31] but can be renamed as you see fit.&#x20;

You may also change the Physics Matrix for these layers. Read more about the  [Physics Matrix here.](https://docs.unity3d.com/Manual/LayerBasedCollision.html)

In Typescript you can use the layers via their name or index.  You can easily get their index with the GameLayer static Enum.

```typescript
// Create a mask from layer names
const layerMask = LayerMask.GetMask("GameLayer0", "GameLayer1");

// Check if an object is a game layer
if (this.gameObject.layer === GameLayer.GAMELAYER_0) {

	//Raycast with a game layer mask
	if (Physics.Raycast(this.transform.position, this.transform.forward, 10, layerMask)) {
		print("Hit a game layer object");
	}
	
}
```

{% hint style="info" %}
You can revert core layers you have renamed by using the menu button&#x20;

**Airship->Misc->Repair Project**&#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.airship.gg/unity-for-airship/physics-layers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
