This still isn't available to non first party widgets which sucks.
Apple, can you please add this?
Post
Replies
Boosts
Views
Activity
Got the same reason today, really weird?
Like they would see if I used Siri Shortcuts features, no?
The flags are under: Settings -> Apps -> Safari (scroll all the way to the bottom) -> Advanced
Also interested in this especially for pathfinding/environment mapping.
I assume you could theoretically play Animations and then move it around but that seems kind of "hacky" in a way, wish Reality Composer Pro had something like ragdoll support.
Using Unity with PolySpatial (when it becomes available) might be an option but I don't think you can integrate Windows with it.
visionOS doesn't give Applications camera passthrough as of now which means you won't be able to scan QR Codes.
I've also noticed this behaviour and believe it to be a bug.
Also, are you using a NavigationStack there or something else?
This is still there and i don't know why.
So is Beta 2 coming anytime soon?
Here: https://developer.apple.com/documentation/visionos
What if I want something to stick out though?
You could either disable "Enable Multiple Windows" , use a State variable or check if the Window is already open programmatically.
Found out how to do it, but not sure if this is the correct way.
This is my component now:
class HungerComponent: Component {
var hungerValue: Int = 100
var passedTime: TimeInterval = TimeInterval(0)
let updateInterval: TimeInterval = TimeInterval(2)
var hungerPublisher = PassthroughSubject<Int, Never>()
required init(hungerValue: Int = 100) {
self.hungerValue = hungerValue
}
func decreaseHunger() {
hungerValue -= 1
hungerPublisher.send(hungerValue)
}
}
And I just add a sink to it in my view:
init(cube: Cube) {
self.cube = cube
if let entity = cube.entity, let hungerComponent = entity.components[HungerComponent.self] {
hungerComponent.hungerPublisher
.sink(receiveValue: { [weak self] hungerValue in
self?.hungerPercentage = Float(hungerValue) / 100.0
})
.store(in: &cancellables)
}
}
If you found out any other way please do tell how.
I just store a reference to the just added entity and then modify that, works for me.
Still unsure about what the use of the update closure actually is.
Actually, using the new @Observable seems to be a better choice for this, I used it like this:
import Foundation
import RealityKit
import Combine
import Observation
@Observable
class HungerComponent: Component {
var hungerValue: Int = 100
var passedTime: TimeInterval = TimeInterval(0)
let updateInterval: TimeInterval = TimeInterval(2)
required init(hungerValue: Int = 100) {
self.hungerValue = hungerValue
}
}
And then I simply access it within my ViewModel like this:
init(character: Character) {
character = character
self.hungerComponent = character.entity?.components[HungerComponent.self] ?? HungerComponent()
}
Which makes it accessible within the View like this:
Text("Hunger: \(viewModel.hungerComponent.hungerValue)")