<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Scene/volumeWorldAlignment(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ScenePAAE20volumeWorldAlignmentyQrAA0eF8BehaviorVF"
  },
  "title" : "volumeWorldAlignment(_:)"
}
-->

# volumeWorldAlignment(_:)

Specifies how a volume should be aligned when moved in the world.

```
nonisolated func volumeWorldAlignment(_ behavior: WorldAlignmentBehavior) -> some Scene
```

## Discussion

For example, you can create a volume that remains parallel to the floor
even when lifted up high above eye level by applying a
[`gravityAligned`](/documentation/SwiftUI/WorldAlignmentBehavior/gravityAligned) alignment to the scene:

```
@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
        .windowStyle(.volumetric)
        .volumeWorldAlignment(.gravityAligned)
    }
}
```

The default value if you don’t apply the modifier is
[`automatic`](/documentation/SwiftUI/WorldAlignmentBehavior/automatic). With that strategy, volumes
will tilt themselves so the front remains fully visible while being
repositioned.

---

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)