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

# childNode(withName:recursively:)

Returns the first node in the node’s child node subtree with the specified name.

```
func childNode(withName name: String, recursively: Bool) -> SCNNode?
```

## Parameters

`name`

The name of the node to search for.

`recursively`

<doc://com.apple.documentation/documentation/Swift/true> to search the entire child node subtree, or <doc://com.apple.documentation/documentation/Swift/false> to search only the node’s immediate children.

## Discussion

If the `recursive` parameter is <doc://com.apple.documentation/documentation/Swift/true>, SceneKit uses a preorder traversal to search the child node subtree—that is, the block searches a node before it searches each of the node’s children, and it searches all children of a node before searching any of that node’s sibling nodes. Otherwise, SceneKit searches only those nodes in the node’s [`childNodes`](/documentation/SceneKit/SCNNode/childNodes) array.

---

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)