---
title: ImpulseAction
framework: realitykit
role: symbol
role_heading: Structure
path: realitykit/impulseaction
---

# ImpulseAction

An action that applies an impulse to the physics body at its center of mass when played as an animation.

## Declaration

```swift
struct ImpulseAction
```

## Overview

Overview This action requires a CollisionComponent and PhysicsBodyComponent with the mode set to PhysicsBodyMode.dynamic. Without these settings, the impulse has no effect on the entity. The example below creates an animation which applies an impulse to the entity after five seconds. // Create an action to apply an impulse, forcing the object to move upwards. let impulseAction = ImpulseAction(linearImpulse: [0, 1, 0])

// Create a small positive duration value. let duration: TimeInterval = 1 / 30.0

// Create an animation for the action, which will start playing // after five seconds. let impulseAnimation = try AnimationResource     .makeActionAnimation(for: impulseAction,                          duration: duration,                          delay: 5.0)

// Play the sequence animation that will play the actions. entity.playAnimation(impulseAnimation) important: This action does not directly animate a bound property, such as BindTarget.transform. tip: This action performs instantaneously, consider supplying a small positive duration value when creating the animation.

## Topics

### Initializers

- [init(targetEntity:linearImpulse:)](realitykit/impulseaction/init(targetentity:linearimpulse:).md)

### Instance Properties

- [animatedValueType](realitykit/impulseaction/animatedvaluetype.md)
- [linearImpulse](realitykit/impulseaction/linearimpulse.md)
- [targetEntity](realitykit/impulseaction/targetentity.md)

## Relationships

### Conforms To

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

## See Also

### Built-in actions

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