<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKScene/camera",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKScene(py)camera"
  },
  "title" : "camera"
}
-->

# camera

The camera node in the scene that determines what part of the scene’s coordinate space is visible in the view.

```
weak var camera: SKCameraNode? { get set }
```

## Discussion

The default value of this property is `nil`, which means that the scene’s [`anchorPoint`](/documentation/SpriteKit/SKScene/anchorPoint) and [`size`](/documentation/SpriteKit/SKScene/size) properties determine what portion of the scene is visible. If set to point to a camera node contained in the scene, the [`anchorPoint`](/documentation/SpriteKit/SKScene/anchorPoint) property is ignored and the scene is rendered using the camera node’s properties instead.

A camera must be added as a child of the scene for it to render that scene.

Listing 1 shows, in Swift, how to add a camera to an [`SKScene`](/documentation/SpriteKit/SKScene) named `scene`. The camera is positioned in the center of the scene which gives the same result as rendering a camera-less scene with an [`anchorPoint`](/documentation/SpriteKit/SKScene/anchorPoint) of <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint/zero>.

Listing 1. Adding a camera to a scene

```swift
let cameraNode = SKCameraNode()
    
cameraNode.position = CGPoint(x: scene.size.width / 2,
                              y: scene.size.height / 2)
    
scene.addChild(cameraNode)
scene.camera = cameraNode
```

For more information, see [`SKCameraNode`](/documentation/SpriteKit/SKCameraNode).

---

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)