I use a .gltf mesh and load it with sceneloader.
I loaded it and add a BABYLON.ActionManager.OnPickTrigger to it. when I add it to a box, it works, but when I add it to my custom mesh, it do not work. why?
code here:
const importPromise = BABYLON.SceneLoader.ImportMeshAsync("", "./assets/models/", "scene.gltf");
importPromise.then((result) => {
var mesh = result.meshes[0];
mesh.actionManager = new BABYLON.ActionManager(scene);
mesh.actionManager.registerAction(
new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickTrigger,
function (evt) {
const sourceMesh = evt.meshUnderPointer;
sourceMesh.scaling = new BABYLON.Vector3(2, 2, 2);
}));
});