<!--
{
  "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/SCNNode/insertChildNode(_:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SCNNode(im)insertChildNode:atIndex:"
  },
  "title" : "insertChildNode(_:at:)"
}
-->

# insertChildNode(_:at:)

Adds a node to the node’s array of children at a specified index.

```
func insertChildNode(_ child: SCNNode, at index: Int)
```

## Parameters

`child`

The node to be inserted.
  
  > Important:
  > Raises an exception (<doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException>) if `child` is `nil`.

`index`

The position at which to insert the new child node.
  
  > Important:
  > Raises an exception (<doc://com.apple.documentation/documentation/Foundation/NSExceptionName/rangeException>) if `index` is greater than the number of elements in the node’s ``doc://com.apple.scenekit/documentation/SceneKit/SCNNode/childNodes`` array.

## Discussion

---

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)