How to set volume alignment
Starting in visionOS 2, volumes can be tilted to face the users. This can make Volumes much more useful when sitting or lying down.
If your Volume needs to stay aligned on the floor, then you can use the volumeWorldAlignment scene modifier.
.volumeWorldAlignment(. automatic)
.volumeWorldAlignment(.gravityAligned)var body: some Scene {
WindowGroup {
ContentView()
.environment(appModel)
}
.windowStyle(.volumetric)
.volumeWorldAlignment(.gravityAligned)
}This will ensure that content is aligned to the floor/ground–similar to the way that Volumes behaved in visionOS 1.
A visionOS simulator video showing two ways to configure volume alignment.
Sample code is available in Garden11 in the Step Into Example Projects repo.
Support our work so we can continue to bring you new examples and articles.
Download the Xcode project with this and many more examples from Step Into Vision.
Some examples are provided as standalone Xcode projects. You can find those here.

Follow Step Into Vision