---
title: "init(fileNamed:)"
framework: gameplaykit
role: symbol
role_heading: Initializer
path: "gameplaykit/gkscene/init(filenamed:)"
---

# init(fileNamed:)

Loads the specified SpriteKit scene file, creating a GKScene object containing the SpriteKit scene and associated GameplayKit objects.

## Declaration

```swift
convenience init?(fileNamed filename: String)
```

## Parameters

- `filename`: The name of a scene file in your app’s main bundle.

## Return Value

Return Value A new GameplayKit scene.

## Discussion

Discussion Use this initializer to load SpriteKit scenes (.sks files) created in the Xcode SpriteKit scene editor that contain associated GameplayKit entities, components, and pathfinding graphs. For more information, see GameplayKit Programming Guide.
