With manipulation component, once you let go, how to prevent the entity from disappearing while animating it back into the volume

So with the new ManipulationComponent, we can choose "stay" and then if you drag it out of your volume, once you let go it will instantly disappear.

We can "animate" it back to inside the volume, eg.:

content.subscribe(to: ManipulationEvents.WillRelease.self) { event in
          Entity.animate(
            .easeInOut(duration: 1),
            body: { event.entity.position = [0, 0.2, 0] },
            completion: {}
          )
      },

Howeve,r for the duration that it travels outside of the volume it's invisible the whole time.

In this apple video, it seems to be visible when dragging and when letting go, but perhaps that's not a volume they're dragging it out of?

https://youtu.be/VtenPKrvPOU?si=y1zoZOs2IMyDzOm6&t=1748

Does anyone know how to keep the entity visible even when after letting the entity go while you animate it back towards inside of your volume?

Hello @mesqueeb , thank you for your question!

It appears to me that in the video the person is dragging the robot, "Sparky", from a Model3D inside a flat window, not a volume. The drag position is then converted into the the coordinate space of the other entity, "Bolts", which I believe is in an immersive space, allowing these entities can interact with each other based on distance.

Except for the animation you're applying to your entity, I don't think this video is particularly relevant to volumetric windows. Volumetric windows will render only the content inside their boundary, but you can extend the boundary for rendered content using preferredWindowClippingMargins(_:_:). You can see a demonstration of this in our Canyon Crosser sample.

However, I think your goal may be to move an entity from a volume into an immersive space, and you can check out the sample Transforming entities between RealityKit coordinate spaces which does exactly this! The trick here is that once the person begins dragging the entity from the volume, it is immediately placed in the immersive scene so that it can render outside the volume. Note that the above sample uses a custom gesture rather than ManipulationComponent because it was released before that API existed. The core concept of using a transform matrix to move from one coordinate space to another and still applies.

Let me know if that helps answer your question!

With manipulation component, once you let go, how to prevent the entity from disappearing while animating it back into the volume
 
 
Q