---
title: OrbitAnimation
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/orbitanimation
---

# OrbitAnimation

An animation that revolves an entity around its origin.

## Declaration

```swift
struct OrbitAnimation
```

## Overview

Overview This class moves an entity in a circular path by gradually adjusting its local transform. The animation sets the entity’s initial position with startTransform and rotates it around the point (0, 0, 0). The axis specifies which cartesian axis around which to rotate. The full orbit completes after duration lapses. If the target entity contains child entities, the target entity orbits the children. Revolve an entity around its origin The following code creates an animation that orbits an entity around the y-axis 3 times over 6 seconds. let yAxis: SIMD3<Float> = [0, 1, 0] let startingPosition: SIMD3<Float> = [0.25, 0, 0]

let orbit = OrbitAnimation(     name: "orbit",     duration: 6,     axis: yAxis,     startTransform: Transform(translation: startingPosition),     spinClockwise: false,     orientToPath: true,     rotationCount: 3,     bindTarget: .transform ) The newly created animation can be trimmed after creation, to last only 4 seconds. // Create an animation clip that skips the first two seconds. let trimmed = orbit.trimmed(start: 2) Use generate(with:) to convert OrbitAnimation to an AnimationResource that can be applied to your entity with playAnimation(_:transitionDuration:blendLayerOffset:separateAnimatedValue:startsPaused:clock:).

## Topics

### Creating an animation

- [init(name:duration:axis:startTransform:spinClockwise:orientToPath:rotationCount:bindTarget:blendLayer:repeatMode:fillMode:isAdditive:trimStart:trimEnd:trimDuration:offset:delay:speed:)](realitykit/orbitanimation/init(name:duration:axis:starttransform:spinclockwise:orienttopath:rotationcount:bindtarget:blendlayer:repeatmode:fillmode:isadditive:trimstart:trimend:trimduration:offset:delay:speed:).md)

### Configuring the animation

- [startTransform](realitykit/orbitanimation/starttransform.md)
- [axis](realitykit/orbitanimation/axis.md)
- [name](realitykit/orbitanimation/name.md)
- [bindTarget](realitykit/orbitanimation/bindtarget.md)
- [blendLayer](realitykit/orbitanimation/blendlayer.md)
- [rotationCount](realitykit/orbitanimation/rotationcount.md)
- [spinClockwise](realitykit/orbitanimation/spinclockwise.md)
- [orientToPath](realitykit/orbitanimation/orienttopath.md)
- [additive](realitykit/orbitanimation/additive.md)

### Timing the animation

- [speed](realitykit/orbitanimation/speed.md)
- [delay](realitykit/orbitanimation/delay.md)
- [duration](realitykit/orbitanimation/duration.md)
- [offset](realitykit/orbitanimation/offset.md)
- [trimDuration](realitykit/orbitanimation/trimduration.md)
- [trimStart](realitykit/orbitanimation/trimstart.md)
- [trimEnd](realitykit/orbitanimation/trimend.md)

### Repeating animation playback

- [repeatMode](realitykit/orbitanimation/repeatmode.md)
- [fillMode](realitykit/orbitanimation/fillmode.md)

## Relationships

### Conforms To

- [AnimationDefinition](realitykit/animationdefinition.md)

## See Also

### Animation definitions

- [SampledAnimation](realitykit/sampledanimation.md)
- [TweenMode](realitykit/tweenmode.md)
- [FromToByAnimation](realitykit/fromtobyanimation.md)
- [AnimationTimingFunction](realitykit/animationtimingfunction.md)
- [AnimationView](realitykit/animationview.md)
- [AnimationDefinition](realitykit/animationdefinition.md)
- [AnimationFillMode](realitykit/animationfillmode.md)
- [AnimationGroup](realitykit/animationgroup.md)
- [AnimationHandoffType](realitykit/animationhandofftype.md)
