Search code examples
arcoresceneform

Place one instance of model in ARCore Sceneform


Having completed the Sceneform quickstart, I'm still having trouble implementing my model placement method...

Rather than each touch of the screen placing a new instance of the model (as in the quickstart & codelab), I'm trying to have each touch reposition the model to that location while still retaining the drag & scale interation.

Any ideas?


Solution

  • ... Hi Mark,

    you can try to save a reference to node that you have created previously at your first touch. I mean the TransformableNode that is used into the codelab. When you touch on another point:

    1- Detach that node from it's current parent.

    2- Attach the node to the new Anchor you have just created on the hit.

    Hope this help.

    Cheers