> For the complete documentation index, see [llms.txt](https://docs.pentafloat.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentafloat.com/documentation/commands/parameters.md).

# Parameters

## Parameter types <a href="#parameter-types" id="parameter-types"></a>

All primitive types and basic Unity value types such as `Vector3` and `Color` are supported out of the box. Also, most types derived from `UnityEngine.Object` can be used as parameters.

This means types like `GameObject`, `ScriptableObject`, `MonoBehaviour` can be used as parameters without any setup.\
When typing the parameter in the command field, we specify the name of the object we want to reference. The object is then found automatically with the given name.

It's also possible to use prefab game objects as parameters. To do this, we can place a `[Prefab]` attribute in front of our parameter. Like so:

```csharp
[Command]
public string SetPrefabTag([Prefab]GameObject prefab, string tag)
{
    if (prefab != null)
        prefab.tag = tag;
}
```

{% hint style="info" %}
**Editor commands**

When making editor commands, asset types like `MonoScript`, `StyleSheet`, `Shader` etc. can also be used as parameters. The assets are found by name, in the asset database.
{% endhint %}

{% hint style="info" %}
**Custom types**

Custom types are also supported as parameters. See the [converters section](/documentation/converters.md) for more details about custom types.
{% endhint %}

## Optional parameters

```csharp
[Command]
public void Damage(int amount = 1)
{
    health -= amount;
}
```

Optional parameter values are also supported. You can simply define a method with default optional parameters. Given the example above, if you were to execute the command without any argument, it would default to dealing 1 damage.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.pentafloat.com/documentation/commands/parameters.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
