<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "PHASE",
  "identifier" : "/documentation/PHASE/PHASEError-swift.struct/invalidObject",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "PHASE"
    ],
    "preciseIdentifier" : "s:SC10PHASEErrorLeV13invalidObjectSoAAVvpZ"
  },
  "title" : "invalidObject"
}
-->

# invalidObject

An error that indicates an object is invalid in a specific context.

```
static var invalidObject: PHASEError.Code { get }
```

## Discussion

The [`addChild(_:)`](/documentation/PHASE/PHASEObject/addChild(_:)) function throws this error if the specified child already has a parent in the scene graph hierarchy.

---

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)