> 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/api/csharp/yarn.unity/yarn.unity.iassetprovider/yarn.unity.iassetprovider.trygetasset.md).

# TryGetAsset\<T>(T?)

Method in [IAssetProvider](/api/csharp/yarn.unity/yarn.unity.iassetprovider.md)

## Summary

Attempts to fetch an asset of type `T` from the object.

```csharp
public bool TryGetAsset<T>([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] out T? result)
    where T : UnityEngine.Object;
```

## Parameters

| Name       | Description                               |
| ---------- | ----------------------------------------- |
| `T` result | On return, the fetched asset, or `null` . |

## Type Parameters

| Name | Description             |
| ---- | ----------------------- |
| T    | The type of the assets. |

## Returns

`true` if an asset was fetched; `false` otherwise.
