<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKAction/run(_:onChildWithName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKAction(cm)runAction:onChildWithName:"
  },
  "title" : "run(_:onChildWithName:)"
}
-->

# run(_:onChildWithName:)

Creates an action that runs an action on a named child object.

```
class func run(_ action: SKAction, onChildWithName name: String) -> SKAction
```

## Parameters

`action`

The action to execute.

`name`

The name of a child object. See the [`name`](/documentation/SpriteKit/SKNode/name) property on the [`SKNode`](/documentation/SpriteKit/SKNode) object.

## Return Value

A new action object.

## Discussion

Because this action references child nodes by name, it is especially handy for nodes that the scene subclass (or scene delegate) does not maintain a reference to, for example, child nodes that are defined in an `.sks` file.

This action has an instantaneous duration, although the action executed on the child may have a duration of its own. When the action executes, it looks up an appropriate child node and calls its [`run(_:)`](/documentation/SpriteKit/SKNode/run(_:)) method, passing in the action to execute.

This action is reversible; it tells the child to execute the reverse of the action specified by the `action` parameter.

---

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)