<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNAnimationEvent/init(keyTime:block:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNAnimationEvent(cm)animationEventWithKeyTime:block:"
  },
  "title" : "init(keyTime:block:)"
}
-->

# init(keyTime:block:)

Creates an animation event.

```
convenience init(keyTime time: CGFloat, block eventBlock: @escaping SCNAnimationEventBlock)
```

## Parameters

`time`

A number between `0.0` and `1.0` specifying the relative time for triggering the event.

`eventBlock`

A block to call at the specified time.

## Return Value

An animation event object.

## Discussion

The `time` parameter is relative to the duration of the animation the event is attached to. For example, an event with a time of `0.5` triggers when the animation is halfway complete, and an event with a time of `1.0` triggers when the animation ends.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)