---
title: BillboardAction
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/billboardaction
---

# BillboardAction

An action that animates the blend factor of an entity’s billboard component.

## Declaration

```swift
struct BillboardAction
```

## Overview

Overview This action animates the blendFactor value of an entity’s BillboardComponent. Over its duration, the action updates the blendFactor property to 1.0. If you provide a transitionIn configuration, the action interpolates the value of the component’s current value for blendFactor towards 1.0. If you provide a transitionOut configuration, the action interpolates the component’s blendFactor value from 1.0 to its original value for that component. The example below creates a three-part animation that: Interpolates blendFactor from 0.0 to 1.0 Pauses for one second Interpolates blendFactor from 1.0 back to 0.0 // Load a robot model from a resource file. let robotModel = try await ModelEntity(named: "vintage_robot")

// A billboard component for the robot model entity. var billboardComponent = BillboardComponent()

// Disable the billboard at the beginning by setting its blend factor to zero. billboardComponent.blendFactor = 0.0

// Add the component to the entity. await robotModel.components.set(billboardComponent)

// A transition that lasts one second. let billboardTransition = BillboardAction.Transition(     duration: 1.0,     timingFunction: .easeInOut )

// An action that starts and ends with a one second transition. let billboardAction = BillboardAction(transitionIn: billboardTransition,                                       transitionOut: billboardTransition)

// A three second animation that adjusts the blend factor twice. // // This animation includes a one second pause between both of the action's // one second transitions in and out by setting the duration one second // longer than action's total time. let billboardAnimation = try AnimationResource     .makeActionAnimation(for: billboardAction,                          duration: 3.0,                          bindTarget: .billboardBlendFactor)

// Play the three second billboard animation that adjusts the blend factor. robotModel.playAnimation(billboardAnimation) note: If an entity doesn’t have a BillboardComponent, the default initializer creates one for you so that it can restore the entity back to a state without the billboard. important: This action directly animates the BindTarget.billboardBlendFactor on the bound entity. Ensure a correct bind target is supplied when creating the animation. Ensure the action can transition back to a non-billboard state by adding the component to the entity and check the blendFactor property has a value that you expect.

## Topics

### Structures

- [BillboardAction.Transition](realitykit/billboardaction/transition.md)

### Initializers

- [init(transitionIn:transitionOut:)](realitykit/billboardaction/init(transitionin:transitionout:).md)

### Instance Properties

- [animatedValueType](realitykit/billboardaction/animatedvaluetype.md)
- [transitionIn](realitykit/billboardaction/transitionin.md)
- [transitionOut](realitykit/billboardaction/transitionout.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [EntityAction](realitykit/entityaction.md)

## See Also

### Built-in actions

- [EmphasizeAction](realitykit/emphasizeaction.md)
- [FromToByAction](realitykit/fromtobyaction.md)
- [ImpulseAction](realitykit/impulseaction.md)
- [OrbitEntityAction](realitykit/orbitentityaction.md)
- [PlayAnimationAction](realitykit/playanimationaction.md)
- [PlayAudioAction](realitykit/playaudioaction.md)
- [SetEntityEnabledAction](realitykit/setentityenabledaction.md)
- [SpinAction](realitykit/spinaction.md)
