Hover effect on GLTF object

Hello
Can I add mouseover event on my GLTF object :heart:

Hello and welcome to the Babylon community! Take a look at Actions | Babylon.js Documentation (babylonjs.com)

// put something like this in your model loaded event
let mesh = model.meshes[1];
    console.log('loaded mesh:', mesh);
    mesh.actionManager = new ActionManager(mesh._scene);
    mesh.actionManager.registerAction(
      new SetValueAction(
          ActionManager.OnPointerOverTrigger,
          mesh.material,
          'wireframe',
          true
      )
    )
    mesh.actionManager.registerAction(
      new SetValueAction(
          ActionManager.OnPointerOutTrigger,
          mesh.material,
          'wireframe',
          false
      )
    )

source: create-react-app-babylonjs/withModel.js

3 Likes