How can I move my model composed by various meshes?

Greetings.
Here is my model to move.

I want to highlight model when I select the model.
And I want to move my model when I click the button(among 4 buttons) and model highlighted.
How can I do this?
:slight_smile:

In terms of highlight, you have multiple options. But keep in mind that you might have to activate the highlight on every mesh you want to be highlighted excluding the root-mesh, which has no vertices.

After creating either GlowLayer or HighlightLayer:

To pick the mesh you can either use onPointerObservable of Scene

scene.onPointerObservable.add((pointerInfo) => {
        // glowLayer.addIncludedOnlyMesh(pointerInfo.pickInfo.pickedMesh)
        // or highlightLayer.addMesh(pointerInfo.pickInfo.pickedMesh, BABYLON.Color3.Green())
}, BABYLON.PointerEventTypes.POINTERDOWN);

I havn’t tested it, so you might have to use scene.meshUnderPointer instead of pointerInfo.pickInfo.pickedMesh.

or individual actionManagers for every mesh:

I wasn’t sure, so I assumed that you want to move model so that the model is moved to left when you click to right-button, but can simply remove negate():

Edit: Newest PG to move by buttons and highlight&glow on pick

3 Likes