Help with RealityKit / Movement in 3D Space

Hey guys, first thanks so much for the great presentation this year, very exited for RealityKit! I'm new to AR but wanted to try it this year. I'm stuck with what should be a simple coding issue:

    func addModel()
    {

        //Create our default model

        //Flat paint
        var flat_paint = PhysicallyBasedMaterial.init()
        flat_paint.baseColor = PhysicallyBasedMaterial.BaseColor(tint:.orange)
        flat_paint.roughness = PhysicallyBasedMaterial.Roughness(floatLiteral: 0.0)
        flat_paint.metallic = PhysicallyBasedMaterial.Metallic(floatLiteral: 0.0)
        flat_paint.clearcoat = .init(floatLiteral: 0.8)

        //Create Clone
        let clone = ptsModel.clone(recursive: true)
        clone.name = "pts_\(clone.id)"
        clone.isEnabled = true
        clone.generateCollisionShapes(recursive: true) //needed to ensure installGestures work
        clone.scale = [0.06, 0.06, 0.06]
        clone.model?.materials = [flat_paint]
        clone.position.y = clone.visualBounds(relativeTo: nil).extents.y * -1 //position below plane, will animate up
        self.anchor.addChild(clone)


        //Animate up through occlusion plane
        DispatchQueue.main.asyncAfter(deadline: .now() + 3.0)
        {
            var translationTransform = clone.transform
            translationTransform.translation.y = clone.visualBounds(relativeTo: nil).extents.y

            let animation = clone.move(to: translationTransform, relativeTo: nil, duration: 2.0, timingFunction: .easeInOut)
        }


        //Add translation gesture to view for clone so we can drag it around
        arView.installGestures([.translation], for: clone)

        //Keep reference to last added clone
        currentSelectedPTSModel = clone.name
    }

The issue is when it animates up it goes too high. If I do something like:

        //Animate up through occlusion plane

        DispatchQueue.main.asyncAfter(deadline: .now() + 3.0)
        {
            var translationTransform = clone.transform
            translationTransform.translation.y = clone.visualBounds(relativeTo: nil).extents.y
            clone.transform = translationTransform

           // let animation = clone.move(to: translationTransform, relativeTo: nil, duration: 2.0, timingFunction: .easeInOut)

        }

and not use the move method, it works as expected, so guessing it has to do with the relativeTo part in the move method? Thanks for any help you can provide!

Sorry, went back and watched https://developer.apple.com/videos/play/wwdc2019/605/ and seem to have something that works :P Thanks for time - let me know if anything I can improve.

    func addModel()
    {
        //Create our default model

        //Flat paint
        var flat_paint = PhysicallyBasedMaterial.init()
        flat_paint.baseColor = PhysicallyBasedMaterial.BaseColor(tint:.orange)
        flat_paint.roughness = PhysicallyBasedMaterial.Roughness(floatLiteral: 0.0)
        flat_paint.metallic = PhysicallyBasedMaterial.Metallic(floatLiteral: 0.0)
        flat_paint.clearcoat = .init(floatLiteral: 0.8)

        //Create Clone
        let clone = ptsModel.clone(recursive: true)
        clone.name = "pts_\(clone.id)"
        clone.isEnabled = true
        clone.generateCollisionShapes(recursive: true) //needed to ensure installGestures work / hitTesting
        clone.scale = [0.05, 0.05, 0.05]
        clone.model?.materials = [flat_paint]
        clone.position.y = clone.visualBounds(relativeTo: nil).extents.y * -1 - 0.001 //position below plane, will animate up
        self.anchor.addChild(clone)

        //Animate up through occlusion plane
        DispatchQueue.main.asyncAfter(deadline: .now() + 3.0)
        {
            var translationTransform = clone.transform
            translationTransform.translation.y = clone.position.y + clone.visualBounds(relativeTo: nil).extents.y + 0.001

            let animation = clone.move(to: translationTransform, relativeTo: clone.parent, duration: 1.0, timingFunction: .easeInOut)

            self.arView.scene.publisher(for: AnimationEvents.PlaybackCompleted.self)
                   .filter { $0.playbackController == animation }
                   .sink(receiveValue: { event in
                       print("Animation complete")
                       print(clone.position.y)
                       event.playbackController.stop()
                   }).store(in: &self.subscriptions)
        }

        //Add translation gesture to view for clone so we can drag it around
        arView.installGestures([.translation], for: clone)

        //Keep reference to last added clone
        currentSelectedPTSModel = clone.name
    }
Help with RealityKit / Movement in 3D Space
 
 
Q