This is a follow up question for this post
There are several entities I created in rcp that I want to play their animations in a sequence (the order is dynamic)
My plan is to have onReceive detecting the notification, remove the current entity from the scene, add the next entity from the queue...
Somehow, when I call removeFromParent()/removeChild(), either it is not removed or everything is removed and the app crashes, any tips?
Post
Replies
Boosts
Views
Activity
A timeline in RCP will post a notification "Identifier: Completed" when it finishes playing
I am trying to receive this in the following way:
extension Notification.Name {
static let notifyOnAnimationCompleted = Notification.Name("Completed")
}
// in the view
private let AnimationCompleted = NotificationCenter.default.publisher(for: .notifyOnAnimationCompleted)
RealityView {...}
.onReceive(AnimationCompleted)
{ _ in
print("End")
}
This was once working back to July, but it never prints "End" for now
I have read this thread to send notification to play animations in RCP.
If I now want to pause and come back later or stop and reset the timeline, is there a way to do so?
Here is what I have discovered:
When I have window A pushes window B, and then B's onAppear dismisses A by its id. In this case, A will not appear if B later dismisses itself unless B calls open/pushWindow(id: A)
However, if I then open an immersive space by A and dismiss it, there will be several B appearing depending on how many times the process I mentioned above was repeated
It does make no sense using onAppear to dismiss A while we later want to reuse it, but is this feature expected?
Hello :)
As title, I have used RCP with reference objects to capture items in real world. My next step is to detect how close the user finger is that object.
I had tried to get the entity's relative position to root but found the position, somehow, is always the same regardless of how and where I move around the camera or the object.
The entity has a child transform with a collision component, which is used to detect collision when the finger is closed enough to calculate the distance, but it fails as well...
Any help will be appreciated, ty
I was able to AirDrop files to other Mac and connect to Vision Pro before updating the system to 15.0 Beta
Currently, here is what I have:
MacOS Version 15.0 Beta (24A5264n) fails to AirDrop files to the other one, while it can drop to the IPhone and that Mac can receive files from that IPhone without any issue
Regarding the Vision Pro, it takes forever for this Mac to connect after pairing.
Does anyone have any idea on what might be the cause?
I was following Explore object tracking for visionOS to load an object reference, but got this error:
Failed to load reference object from URL: ObjectTrackingProvider.Error(code: referenceObjectLoadingFailed, errorDescription: "The operation couldn’t be completed. (com.apple.arkit error 1101.)", failureReason: "", recoverySuggestion: ""
Here is what I have, not sure if it is an code error, or something with the system:
private func loadReferenceObject() {
Task {
// Load the reference object
let refObjURL = Bundle.main.url(forResource: "objectTrackerBox", withExtension: ".referenceobject")
if let refObjURL = refObjURL {
do {
let refObj = try await ReferenceObject(from: refObjURL)
logMessage = "Reference object loaded successfully: \(refObj)"
print(logMessage)
} catch {
logMessage = "Failed to load reference object from URL: \(error)"
print(logMessage)
}
} else {
logMessage = "Failed to find the reference object file."
print(logMessage)
}
}
}