> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.2/api/csharp/yarn.unity/yarn.unity.yarnfunctionattribute.md).

# YarnFunctionAttribute

Class in [Yarn.Unity](/2.2/api/csharp/yarn.unity.md)

Inherits from [`YarnActionAttribute`](/2.2/api/csharp/yarn.unity/yarn.unity.yarnactionattribute.md)

## Summary

Marks the method as a function to be registered with the running instance's library.

```csharp
public class YarnFunctionAttribute : YarnActionAttribute
```

## Remarks

See `Library.RegisterFunction(string, Delegate)` and the generic overloads for what is and is not valid.

This will throw an error if you attempt to add a function that has more than 16 parameters, as that is the largest overload that `Func<TResult>` etc has.

## Properties

| Name                                                                                                                         | Description |
| ---------------------------------------------------------------------------------------------------------------------------- | ----------- |
| [FunctionName](/2.2/api/csharp/yarn.unity/yarn.unity.yarnfunctionattribute/yarn.unity.yarnfunctionattribute.functionname.md) |             |
