---
title: "generate(with:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/animationresource/generate(with:)"
---

# generate(with:)

Creates an animation resource from a definition.

## Declaration

```swift
@MainActor @preconcurrency static func generate(with definition: any AnimationDefinition) throws -> AnimationResource
```

## Parameters

- `definition`: The configuration of a timeframe and visual semantics from which to generate an animation resource.

## Return Value

Return Value An animation resource that shares the configuration of the definition.

## See Also

### Creating an animation resource

- [sequence(with:)](realitykit/animationresource/sequence(with:).md)
- [group(with:)](realitykit/animationresource/group(with:).md)
- [repeat(count:)](realitykit/animationresource/repeat(count:).md)
- [repeat(duration:)](realitykit/animationresource/repeat(duration:).md)
